From 3aa2bf70f619a32666c691101be4a30430186daa Mon Sep 17 00:00:00 2001 From: Carsten Varming Date: Mon, 18 Jul 2016 12:22:41 -0400 Subject: [PATCH 01/17] Stock ASM 5.1, all customizations reverted --- .../scala/tools/asm/AnnotationVisitor.java | 16 +- .../scala/tools/asm/AnnotationWriter.java | 14 +- src/main/java/scala/tools/asm/Attribute.java | 22 +- src/main/java/scala/tools/asm/ByteVector.java | 26 +- .../java/scala/tools/asm/ClassReader.java | 93 +- .../java/scala/tools/asm/ClassVisitor.java | 26 +- .../java/scala/tools/asm/ClassWriter.java | 146 +-- src/main/java/scala/tools/asm/Context.java | 6 +- src/main/java/scala/tools/asm/CustomAttr.java | 20 - src/main/java/scala/tools/asm/Edge.java | 4 +- .../java/scala/tools/asm/FieldVisitor.java | 14 +- .../java/scala/tools/asm/FieldWriter.java | 10 +- src/main/java/scala/tools/asm/Frame.java | 50 +- src/main/java/scala/tools/asm/Handle.java | 80 +- src/main/java/scala/tools/asm/Handler.java | 6 +- src/main/java/scala/tools/asm/Item.java | 28 +- src/main/java/scala/tools/asm/Label.java | 44 +- .../java/scala/tools/asm/MethodVisitor.java | 68 +- .../java/scala/tools/asm/MethodWriter.java | 63 +- src/main/java/scala/tools/asm/Opcodes.java | 4 +- src/main/java/scala/tools/asm/Type.java | 88 +- src/main/java/scala/tools/asm/TypePath.java | 14 +- .../java/scala/tools/asm/TypeReference.java | 48 +- .../tools/asm/commons/CodeSizeEvaluator.java | 12 +- .../tools/asm/signature/SignatureReader.java | 20 +- .../tools/asm/signature/SignatureVisitor.java | 36 +- .../tools/asm/signature/SignatureWriter.java | 14 +- .../tools/asm/tree/AbstractInsnNode.java | 36 +- .../scala/tools/asm/tree/AnnotationNode.java | 22 +- .../java/scala/tools/asm/tree/ClassNode.java | 66 +- .../scala/tools/asm/tree/FieldInsnNode.java | 18 +- .../java/scala/tools/asm/tree/FieldNode.java | 56 +- .../java/scala/tools/asm/tree/FrameNode.java | 12 +- .../scala/tools/asm/tree/IincInsnNode.java | 12 +- .../scala/tools/asm/tree/InnerClassNode.java | 18 +- .../java/scala/tools/asm/tree/InsnList.java | 77 +- .../java/scala/tools/asm/tree/InsnNode.java | 10 +- .../scala/tools/asm/tree/IntInsnNode.java | 10 +- .../tools/asm/tree/InvokeDynamicInsnNode.java | 16 +- .../scala/tools/asm/tree/JumpInsnNode.java | 10 +- .../java/scala/tools/asm/tree/LabelNode.java | 8 +- .../scala/tools/asm/tree/LdcInsnNode.java | 14 +- .../scala/tools/asm/tree/LineNumberNode.java | 8 +- .../asm/tree/LocalVariableAnnotationNode.java | 20 +- .../tools/asm/tree/LocalVariableNode.java | 10 +- .../tools/asm/tree/LookupSwitchInsnNode.java | 12 +- .../scala/tools/asm/tree/MethodInsnNode.java | 29 +- .../java/scala/tools/asm/tree/MethodNode.java | 88 +- .../asm/tree/MultiANewArrayInsnNode.java | 16 +- .../scala/tools/asm/tree/ParameterNode.java | 14 +- .../tools/asm/tree/TableSwitchInsnNode.java | 14 +- .../tools/asm/tree/TryCatchBlockNode.java | 20 +- .../tools/asm/tree/TypeAnnotationNode.java | 14 +- .../scala/tools/asm/tree/TypeInsnNode.java | 16 +- .../scala/tools/asm/tree/VarInsnNode.java | 12 +- .../tools/asm/tree/analysis/Analyzer.java | 73 +- .../asm/tree/analysis/AnalyzerException.java | 6 +- .../asm/tree/analysis/BasicInterpreter.java | 26 +- .../tools/asm/tree/analysis/BasicValue.java | 6 +- .../asm/tree/analysis/BasicVerifier.java | 14 +- .../scala/tools/asm/tree/analysis/Frame.java | 128 ++- .../tools/asm/tree/analysis/Interpreter.java | 108 +-- .../asm/tree/analysis/SimpleVerifier.java | 12 +- .../tools/asm/tree/analysis/SmallSet.java | 4 +- .../asm/tree/analysis/SourceInterpreter.java | 18 +- .../tools/asm/tree/analysis/SourceValue.java | 10 +- .../tools/asm/tree/analysis/Subroutine.java | 10 +- .../scala/tools/asm/tree/analysis/Value.java | 6 +- .../java/scala/tools/asm/util/ASMifiable.java | 10 +- .../java/scala/tools/asm/util/ASMifier.java | 50 +- .../asm/util/CheckAnnotationAdapter.java | 10 +- .../tools/asm/util/CheckClassAdapter.java | 102 +-- .../tools/asm/util/CheckFieldAdapter.java | 18 +- .../tools/asm/util/CheckMethodAdapter.java | 81 +- .../tools/asm/util/CheckSignatureAdapter.java | 12 +- .../java/scala/tools/asm/util/Printer.java | 836 +++++++++++++++--- .../scala/tools/asm/util/Textifiable.java | 12 +- .../java/scala/tools/asm/util/Textifier.java | 20 +- .../asm/util/TraceAnnotationVisitor.java | 8 +- .../tools/asm/util/TraceClassVisitor.java | 40 +- .../tools/asm/util/TraceFieldVisitor.java | 14 +- .../tools/asm/util/TraceMethodVisitor.java | 18 +- .../tools/asm/util/TraceSignatureVisitor.java | 22 +- 83 files changed, 1952 insertions(+), 1352 deletions(-) delete mode 100644 src/main/java/scala/tools/asm/CustomAttr.java diff --git a/src/main/java/scala/tools/asm/AnnotationVisitor.java b/src/main/java/scala/tools/asm/AnnotationVisitor.java index abcaf1d..b644083 100644 --- a/src/main/java/scala/tools/asm/AnnotationVisitor.java +++ b/src/main/java/scala/tools/asm/AnnotationVisitor.java @@ -27,13 +27,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A visitor to visit a Java annotation. The methods of this class must be * called in the following order: ( visit | visitEnum | * visitAnnotation | visitArray )* visitEnd. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -53,7 +53,7 @@ public abstract class AnnotationVisitor { /** * Constructs a new {@link AnnotationVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -64,7 +64,7 @@ public AnnotationVisitor(final int api) { /** * Constructs a new {@link AnnotationVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -82,7 +82,7 @@ public AnnotationVisitor(final int api, final AnnotationVisitor av) { /** * Visits a primitive value of the annotation. - * + * * @param name * the value name. * @param value @@ -103,7 +103,7 @@ public void visit(String name, Object value) { /** * Visits an enumeration value of the annotation. - * + * * @param name * the value name. * @param desc @@ -119,7 +119,7 @@ public void visitEnum(String name, String desc, String value) { /** * Visits a nested annotation value of the annotation. - * + * * @param name * the value name. * @param desc @@ -142,7 +142,7 @@ public AnnotationVisitor visitAnnotation(String name, String desc) { * types (such as byte, boolean, short, char, int, long, float or double) * can be passed as value to {@link #visit visit}. This is what * {@link ClassReader} does. - * + * * @param name * the value name. * @return a visitor to visit the actual array value elements, or diff --git a/src/main/java/scala/tools/asm/AnnotationWriter.java b/src/main/java/scala/tools/asm/AnnotationWriter.java index 6de74ce..6b95608 100644 --- a/src/main/java/scala/tools/asm/AnnotationWriter.java +++ b/src/main/java/scala/tools/asm/AnnotationWriter.java @@ -27,11 +27,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * An {@link AnnotationVisitor} that generates annotations in bytecode form. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -89,7 +89,7 @@ final class AnnotationWriter extends AnnotationVisitor { /** * Constructs a new {@link AnnotationWriter}. - * + * * @param cw * the class writer to which this annotation must be added. * @param named @@ -237,7 +237,7 @@ public void visitEnd() { /** * Returns the size of this annotation writer list. - * + * * @return the size of this annotation writer list. */ int getSize() { @@ -253,7 +253,7 @@ int getSize() { /** * Puts the annotations of this annotation writer list into the given byte * vector. - * + * * @param out * where the annotations must be put. */ @@ -281,7 +281,7 @@ void put(final ByteVector out) { /** * Puts the given annotation lists into the given byte vector. - * + * * @param panns * an array of annotation writer lists. * @param off @@ -319,7 +319,7 @@ static void put(final AnnotationWriter[] panns, final int off, /** * Puts the given type reference and type path into the given bytevector. * LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported. - * + * * @param typeRef * a reference to the annotated type. See {@link TypeReference}. * @param typePath diff --git a/src/main/java/scala/tools/asm/Attribute.java b/src/main/java/scala/tools/asm/Attribute.java index ac40a75..8a2a882 100644 --- a/src/main/java/scala/tools/asm/Attribute.java +++ b/src/main/java/scala/tools/asm/Attribute.java @@ -27,11 +27,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A non standard class, field, method or code attribute. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -54,7 +54,7 @@ public class Attribute { /** * Constructs a new empty attribute. - * + * * @param type * the type of the attribute. */ @@ -65,7 +65,7 @@ protected Attribute(final String type) { /** * Returns true if this type of attribute is unknown. The default * implementation of this method always returns true. - * + * * @return true if this type of attribute is unknown. */ public boolean isUnknown() { @@ -74,7 +74,7 @@ public boolean isUnknown() { /** * Returns true if this type of attribute is a code attribute. - * + * * @return true if this type of attribute is a code attribute. */ public boolean isCodeAttribute() { @@ -83,7 +83,7 @@ public boolean isCodeAttribute() { /** * Returns the labels corresponding to this attribute. - * + * * @return the labels corresponding to this attribute, or null if * this attribute is not a code attribute that contains labels. */ @@ -96,7 +96,7 @@ protected Label[] getLabels() { * new {@link Attribute} object, of type {@link #type type}, * corresponding to the len bytes starting at the given offset, in * the given class reader. - * + * * @param cr * the class that contains the attribute to be read. * @param off @@ -133,7 +133,7 @@ protected Attribute read(final ClassReader cr, final int off, /** * Returns the byte array form of this attribute. - * + * * @param cw * the class to which this attribute must be added. This * parameter can be used to add to the constant pool of this @@ -166,7 +166,7 @@ protected ByteVector write(final ClassWriter cw, final byte[] code, /** * Returns the length of the attribute list that begins with this attribute. - * + * * @return the length of the attribute list that begins with this attribute. */ final int getCount() { @@ -181,7 +181,7 @@ final int getCount() { /** * Returns the size of all the attributes in this attribute list. - * + * * @param cw * the class writer to be used to convert the attributes into * byte arrays, with the {@link #write write} method. @@ -219,7 +219,7 @@ final int getSize(final ClassWriter cw, final byte[] code, final int len, /** * Writes all the attributes of this attribute list in the given byte * vector. - * + * * @param cw * the class writer to be used to convert the attributes into * byte arrays, with the {@link #write write} method. diff --git a/src/main/java/scala/tools/asm/ByteVector.java b/src/main/java/scala/tools/asm/ByteVector.java index 3bca7af..9c532be 100644 --- a/src/main/java/scala/tools/asm/ByteVector.java +++ b/src/main/java/scala/tools/asm/ByteVector.java @@ -27,12 +27,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A dynamically extensible vector of bytes. This class is roughly equivalent to * a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient. - * + * * @author Eric Bruneton */ public class ByteVector { @@ -58,7 +58,7 @@ public ByteVector() { /** * Constructs a new {@link ByteVector ByteVector} with the given initial * size. - * + * * @param initialSize * the initial size of the byte vector to be constructed. */ @@ -69,7 +69,7 @@ public ByteVector(final int initialSize) { /** * Puts a byte into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param b * a byte. * @return this byte vector. @@ -87,7 +87,7 @@ public ByteVector putByte(final int b) { /** * Puts two bytes into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param b1 * a byte. * @param b2 @@ -109,7 +109,7 @@ ByteVector put11(final int b1, final int b2) { /** * Puts a short into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param s * a short. * @return this byte vector. @@ -129,7 +129,7 @@ public ByteVector putShort(final int s) { /** * Puts a byte and a short into this byte vector. The byte vector is * automatically enlarged if necessary. - * + * * @param b * a byte. * @param s @@ -152,7 +152,7 @@ ByteVector put12(final int b, final int s) { /** * Puts an int into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param i * an int. * @return this byte vector. @@ -174,7 +174,7 @@ public ByteVector putInt(final int i) { /** * Puts a long into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param l * a long. * @return this byte vector. @@ -202,7 +202,7 @@ public ByteVector putLong(final long l) { /** * Puts an UTF8 string into this byte vector. The byte vector is * automatically enlarged if necessary. - * + * * @param s * a String whose UTF8 encoded length must be less than 65536. * @return this byte vector. @@ -243,7 +243,7 @@ public ByteVector putUTF8(final String s) { * automatically enlarged if necessary. The string length is encoded in two * bytes before the encoded characters, if there is space for that (i.e. if * this.length - i - 2 >= 0). - * + * * @param s * the String to encode. * @param i @@ -301,7 +301,7 @@ ByteVector encodeUTF8(final String s, int i, int maxByteLength) { /** * Puts an array of bytes into this byte vector. The byte vector is * automatically enlarged if necessary. - * + * * @param b * an array of bytes. May be null to put len * null bytes into this byte vector. @@ -324,7 +324,7 @@ public ByteVector putByteArray(final byte[] b, final int off, final int len) { /** * Enlarge this byte vector so that it can receive n more bytes. - * + * * @param size * number of additional bytes that this byte vector should be * able to receive. diff --git a/src/main/java/scala/tools/asm/ClassReader.java b/src/main/java/scala/tools/asm/ClassReader.java index 47039b0..76b1600 100644 --- a/src/main/java/scala/tools/asm/ClassReader.java +++ b/src/main/java/scala/tools/asm/ClassReader.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; import java.io.IOException; import java.io.InputStream; @@ -37,7 +37,7 @@ * This class parses a byte array conforming to the Java class file format and * calls the appropriate visit methods of a given class visitor for each field, * method and bytecode instruction encountered. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -145,7 +145,7 @@ public class ClassReader { /** * Constructs a new {@link ClassReader} object. - * + * * @param b * the bytecode of the class to be read. */ @@ -155,7 +155,7 @@ public ClassReader(final byte[] b) { /** * Constructs a new {@link ClassReader} object. - * + * * @param b * the bytecode of the class to be read. * @param off @@ -220,9 +220,9 @@ public ClassReader(final byte[] b, final int off, final int len) { * Returns the class's access flags (see {@link Opcodes}). This value may * not reflect Deprecated and Synthetic flags when bytecode is before 1.5 * and those flags are represented by attributes. - * + * * @return the class access flags - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public int getAccess() { @@ -232,9 +232,9 @@ public int getAccess() { /** * Returns the internal name of the class (see * {@link Type#getInternalName() getInternalName}). - * + * * @return the internal class name - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public String getClassName() { @@ -245,10 +245,10 @@ public String getClassName() { * Returns the internal of name of the super class (see * {@link Type#getInternalName() getInternalName}). For interfaces, the * super class is {@link Object}. - * + * * @return the internal name of super class, or null for * {@link Object} class. - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public String getSuperName() { @@ -258,10 +258,10 @@ public String getSuperName() { /** * Returns the internal names of the class's interfaces (see * {@link Type#getInternalName() getInternalName}). - * + * * @return the array of internal names for all implemented interfaces or * null. - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public String[] getInterfaces() { @@ -281,7 +281,7 @@ public String[] getInterfaces() { /** * Copies the constant pool data into the given {@link ClassWriter}. Should * be called before the {@link #accept(ClassVisitor,int)} method. - * + * * @param classWriter * the {@link ClassWriter} to copy constant pool into. */ @@ -369,7 +369,7 @@ void copyPool(final ClassWriter classWriter) { /** * Copies the bootstrap method data into the given {@link ClassWriter}. * Should be called before the {@link #accept(ClassVisitor,int)} method. - * + * * @param classWriter * the {@link ClassWriter} to copy bootstrap methods into. */ @@ -414,7 +414,7 @@ private void copyBootstrapMethods(final ClassWriter classWriter, /** * Constructs a new {@link ClassReader} object. - * + * * @param is * an input stream from which to read the class. * @throws IOException @@ -426,7 +426,7 @@ public ClassReader(final InputStream is) throws IOException { /** * Constructs a new {@link ClassReader} object. - * + * * @param name * the binary qualified name of the class to be read. * @throws IOException @@ -440,7 +440,7 @@ public ClassReader(final String name) throws IOException { /** * Reads the bytecode of a class. - * + * * @param is * an input stream from which to read the class. * @param close @@ -494,7 +494,7 @@ private static byte[] readClass(final InputStream is, boolean close) * Makes the given visitor visit the Java class of this {@link ClassReader} * . This class is the one specified in the constructor (see * {@link #ClassReader(byte[]) ClassReader}). - * + * * @param classVisitor * the visitor that must visit this class. * @param flags @@ -510,7 +510,7 @@ public void accept(final ClassVisitor classVisitor, final int flags) { * Makes the given visitor visit the Java class of this {@link ClassReader}. * This class is the one specified in the constructor (see * {@link #ClassReader(byte[]) ClassReader}). - * + * * @param classVisitor * the visitor that must visit this class. * @param attrs @@ -699,7 +699,7 @@ public void accept(final ClassVisitor classVisitor, /** * Reads a field and makes the given visitor visit it. - * + * * @param classVisitor * the visitor that must visit the field. * @param context @@ -817,7 +817,7 @@ private int readField(final ClassVisitor classVisitor, /** * Reads a method and makes the given visitor visit it. - * + * * @param classVisitor * the visitor that must visit the method. * @param context @@ -1025,7 +1025,7 @@ private int readMethod(final ClassVisitor classVisitor, /** * Reads the bytecode of a method and makes the given visitor visit it. - * + * * @param mv * the visitor that must visit the method's code. * @param context @@ -1570,7 +1570,7 @@ context.end, context.index, readUTF8(v, c), /** * Parses a type annotation table to find the labels, and to visit the try * catch block annotations. - * + * * @param u * the start offset of a type annotation table. * @param mv @@ -1653,7 +1653,7 @@ private int[] readTypeAnnotations(final MethodVisitor mv, * start offset of the rest of the type_annotation structure (i.e. the * offset to the type_index field, which is followed by * num_element_value_pairs and then the name,value pairs). - * + * * @param context * information about the class being parsed. This is where the * extracted target_type and target_path must be stored. @@ -1724,7 +1724,7 @@ private int readAnnotationTarget(final Context context, int u) { /** * Reads parameter annotations and makes the given visitor visit them. - * + * * @param mv * the visitor that must visit the annotations. * @param context @@ -1767,7 +1767,7 @@ private void readParameterAnnotations(final MethodVisitor mv, /** * Reads the values of an annotation and makes the given visitor visit them. - * + * * @param v * the start offset in {@link #b b} of the values to be read * (including the unsigned short that gives the number of @@ -1803,7 +1803,7 @@ private int readAnnotationValues(int v, final char[] buf, /** * Reads a value of an annotation and makes the given visitor visit it. - * + * * @param v * the start offset in {@link #b b} of the value to be read * (not including the value name constant pool index). @@ -1966,7 +1966,7 @@ private int readAnnotationValue(int v, final char[] buf, final String name, /** * Computes the implicit frame of the method currently being parsed (as * defined in the given {@link Context}) and stores it in the given context. - * + * * @param frame * information about the class being parsed. */ @@ -2029,7 +2029,7 @@ private void getImplicitFrame(final Context frame) { /** * Reads a stack map frame and stores the result in the given * {@link Context} object. - * + * * @param stackMap * the start offset of a stack map frame in the class file. * @param zip @@ -2115,7 +2115,7 @@ private int readFrame(int stackMap, boolean zip, boolean unzip, /** * Reads a stack map frame type and stores it at the given index in the * given array. - * + * * @param frame * the array where the parsed type must be stored. * @param index @@ -2171,7 +2171,7 @@ private int readFrameType(final Object[] frame, final int index, int v, * Returns the label corresponding to the given offset. The default * implementation of this method creates a label for the given offset if it * has not been already created. - * + * * @param offset * a bytecode offset in a method. * @param labels @@ -2189,7 +2189,7 @@ protected Label readLabel(int offset, Label[] labels) { /** * Returns the start index of the attribute_info structure of this class. - * + * * @return the start index of the attribute_info structure of this class. */ private int getAttributes() { @@ -2215,7 +2215,7 @@ private int getAttributes() { /** * Reads an attribute in {@link #b b}. - * + * * @param attrs * prototypes of the attributes that must be parsed during the * visit of the class. Any attribute whose type is not equal to @@ -2263,7 +2263,7 @@ private Attribute readAttribute(final Attribute[] attrs, final String type, /** * Returns the number of constant pool items in {@link #b b}. - * + * * @return the number of constant pool items in {@link #b b}. */ public int getItemCount() { @@ -2274,7 +2274,7 @@ public int getItemCount() { * Returns the start index of the constant pool item in {@link #b b}, plus * one. This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param item * the index a constant pool item. * @return the start index of the constant pool item in {@link #b b}, plus @@ -2287,7 +2287,7 @@ public int getItem(final int item) { /** * Returns the maximum length of the strings contained in the constant pool * of the class. - * + * * @return the maximum length of the strings contained in the constant pool * of the class. */ @@ -2299,7 +2299,7 @@ public int getMaxStringLength() { * Reads a byte value in {@link #b b}. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2312,7 +2312,7 @@ public int readByte(final int index) { * Reads an unsigned short value in {@link #b b}. This method is intended * for {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2326,7 +2326,7 @@ public int readUnsignedShort(final int index) { * Reads a signed short value in {@link #b b}. This method is intended * for {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2340,7 +2340,7 @@ public short readShort(final int index) { * Reads a signed int value in {@link #b b}. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2355,7 +2355,7 @@ public int readInt(final int index) { * Reads a signed long value in {@link #b b}. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2370,7 +2370,7 @@ public long readLong(final int index) { * Reads an UTF8 string constant pool item in {@link #b b}. This method * is intended for {@link Attribute} sub classes, and is normally not needed * by class generators or adapters. - * + * * @param index * the start index of an unsigned short value in {@link #b b}, * whose value is the index of an UTF8 constant pool item. @@ -2394,7 +2394,7 @@ public String readUTF8(int index, final char[] buf) { /** * Reads UTF8 string in {@link #b b}. - * + * * @param index * start offset of the UTF8 string to be read. * @param utfLen @@ -2445,7 +2445,7 @@ private String readUTF(int index, final int utfLen, final char[] buf) { * Reads a class constant pool item in {@link #b b}. This method is * intended for {@link Attribute} sub classes, and is normally not needed by * class generators or adapters. - * + * * @param index * the start index of an unsigned short value in {@link #b b}, * whose value is the index of a class constant pool item. @@ -2465,7 +2465,7 @@ public String readClass(final int index, final char[] buf) { * Reads a numeric or string constant pool item in {@link #b b}. This * method is intended for {@link Attribute} sub classes, and is normally not * needed by class generators or adapters. - * + * * @param item * the index of a constant pool item. * @param buf @@ -2496,11 +2496,12 @@ public Object readConst(final int item, final char[] buf) { int tag = readByte(index); int[] items = this.items; int cpIndex = items[readUnsignedShort(index + 1)]; + boolean itf = b[cpIndex - 1] == ClassWriter.IMETH; String owner = readClass(cpIndex, buf); cpIndex = items[readUnsignedShort(cpIndex + 2)]; String name = readUTF8(cpIndex, buf); String desc = readUTF8(cpIndex + 2, buf); - return new Handle(tag, owner, name, desc); + return new Handle(tag, owner, name, desc, itf); } } } diff --git a/src/main/java/scala/tools/asm/ClassVisitor.java b/src/main/java/scala/tools/asm/ClassVisitor.java index 48dc2ca..107ada0 100644 --- a/src/main/java/scala/tools/asm/ClassVisitor.java +++ b/src/main/java/scala/tools/asm/ClassVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A visitor to visit a Java class. The methods of this class must be called in @@ -36,7 +36,7 @@ * visitTypeAnnotation | visitAttribute )* ( * visitInnerClass | visitField | visitMethod )* * visitEnd. - * + * * @author Eric Bruneton */ public abstract class ClassVisitor { @@ -55,7 +55,7 @@ public abstract class ClassVisitor { /** * Constructs a new {@link ClassVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -66,7 +66,7 @@ public ClassVisitor(final int api) { /** * Constructs a new {@link ClassVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -84,7 +84,7 @@ public ClassVisitor(final int api, final ClassVisitor cv) { /** * Visits the header of the class. - * + * * @param version * the class version. * @param access @@ -116,7 +116,7 @@ public void visit(int version, int access, String name, String signature, /** * Visits the source of the class. - * + * * @param source * the name of the source file from which the class was compiled. * May be null. @@ -134,7 +134,7 @@ public void visitSource(String source, String debug) { /** * Visits the enclosing class of the class. This method must be called only * if the class has an enclosing class. - * + * * @param owner * internal name of the enclosing class of the class. * @param name @@ -154,7 +154,7 @@ public void visitOuterClass(String owner, String name, String desc) { /** * Visits an annotation of the class. - * + * * @param desc * the class descriptor of the annotation class. * @param visible @@ -171,7 +171,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) { /** * Visits an annotation on a type in the class signature. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#CLASS_TYPE_PARAMETER @@ -204,7 +204,7 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef, /** * Visits a non standard attribute of the class. - * + * * @param attr * an attribute. */ @@ -217,7 +217,7 @@ public void visitAttribute(Attribute attr) { /** * Visits information about an inner class. This inner class is not * necessarily a member of the class being visited. - * + * * @param name * the internal name of an inner class (see * {@link Type#getInternalName() getInternalName}). @@ -241,7 +241,7 @@ public void visitInnerClass(String name, String outerName, /** * Visits a field of the class. - * + * * @param access * the field's access flags (see {@link Opcodes}). This parameter * also indicates if the field is synthetic and/or deprecated. @@ -278,7 +278,7 @@ public FieldVisitor visitField(int access, String name, String desc, * Visits a method of the class. This method must return a new * {@link MethodVisitor} instance (or null) each time it is called, * i.e., it should not return a previously returned visitor. - * + * * @param access * the method's access flags (see {@link Opcodes}). This * parameter also indicates if the method is synthetic and/or diff --git a/src/main/java/scala/tools/asm/ClassWriter.java b/src/main/java/scala/tools/asm/ClassWriter.java index a8cebb9..f4dd6c6 100644 --- a/src/main/java/scala/tools/asm/ClassWriter.java +++ b/src/main/java/scala/tools/asm/ClassWriter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A {@link ClassVisitor} that generates classes in bytecode form. More @@ -35,7 +35,7 @@ * file format. It can be used alone, to generate a Java class "from scratch", * or with one or more {@link ClassReader ClassReader} and adapter class visitor * to generate a modified class from one or more existing Java classes. - * + * * @author Eric Bruneton */ public class ClassWriter extends ClassVisitor { @@ -47,7 +47,7 @@ public class ClassWriter extends ClassVisitor { * {@link MethodVisitor} returned by the {@link #visitMethod visitMethod} * method will be ignored, and computed automatically from the signature and * the bytecode of each method. - * + * * @see #ClassWriter(int) */ public static final int COMPUTE_MAXS = 1; @@ -60,7 +60,7 @@ public class ClassWriter extends ClassVisitor { * {@link MethodVisitor#visitMaxs visitMaxs} method are also ignored and * recomputed from the bytecode. In other words, computeFrames implies * computeMaxs. - * + * * @see #ClassWriter(int) */ public static final int COMPUTE_FRAMES = 2; @@ -598,7 +598,7 @@ public class ClassWriter extends ClassVisitor { /** * Constructs a new {@link ClassWriter} object. - * + * * @param flags * option flags that can be used to modify the default behavior * of this class. See {@link #COMPUTE_MAXS}, @@ -622,7 +622,7 @@ public ClassWriter(final int flags) { * Constructs a new {@link ClassWriter} object and enables optimizations for * "mostly add" bytecode transformations. These optimizations are the * following: - * + * * - * + * * @param classReader * the {@link ClassReader} used to read the original class. It * will be used to copy the entire constant pool from the @@ -804,7 +804,7 @@ public final void visitEnd() { /** * Returns the bytecode of the class that was build with this class writer. - * + * * @return the bytecode of the class that was build with this class writer. */ public byte[] toByteArray() { @@ -1005,7 +1005,7 @@ public byte[] toByteArray() { /** * Adds a number or string constant to the constant pool of the class being * build. Does nothing if the constant pool already contains a similar item. - * + * * @param cst * the value of the constant to be added to the constant pool. * This parameter must be an {@link Integer}, a {@link Float}, a @@ -1052,7 +1052,7 @@ Item newConstItem(final Object cst) { } } else if (cst instanceof Handle) { Handle h = (Handle) cst; - return newHandleItem(h.tag, h.owner, h.name, h.desc); + return newHandleItem(h.tag, h.owner, h.name, h.desc, h.itf); } else { throw new IllegalArgumentException("value " + cst); } @@ -1063,7 +1063,7 @@ Item newConstItem(final Object cst) { * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param cst * the value of the constant to be added to the constant pool. * This parameter must be an {@link Integer}, a {@link Float}, a @@ -1080,7 +1080,7 @@ public int newConst(final Object cst) { * nothing if the constant pool already contains a similar item. This * method is intended for {@link Attribute} sub classes, and is normally not * needed by class generators or adapters. - * + * * @param value * the String value. * @return the index of a new or already existing UTF8 item. @@ -1101,7 +1101,7 @@ public int newUTF8(final String value) { * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param value * the internal name of the class. * @return a new or already existing class reference item. @@ -1122,7 +1122,7 @@ Item newClassItem(final String value) { * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param value * the internal name of the class. * @return the index of a new or already existing class reference item. @@ -1136,7 +1136,7 @@ public int newClass(final String value) { * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param methodDesc * method descriptor of the method type. * @return a new or already existing method type reference item. @@ -1157,7 +1157,7 @@ Item newMethodTypeItem(final String methodDesc) { * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param methodDesc * method descriptor of the method type. * @return the index of a new or already existing method type reference @@ -1172,7 +1172,7 @@ public int newMethodType(final String methodDesc) { * if the constant pool already contains a similar item. This method is * intended for {@link Attribute} sub classes, and is normally not needed by * class generators or adapters. - * + * * @param tag * the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, @@ -1187,10 +1187,12 @@ public int newMethodType(final String methodDesc) { * the name of the field or method. * @param desc * the descriptor of the field or method. + * @param itf + * true if the owner is an interface. * @return a new or an already existing method type reference item. */ Item newHandleItem(final int tag, final String owner, final String name, - final String desc) { + final String desc, final boolean itf) { key4.set(HANDLE_BASE + tag, owner, name, desc); Item result = get(key4); if (result == null) { @@ -1199,8 +1201,7 @@ Item newHandleItem(final int tag, final String owner, final String name, } else { put112(HANDLE, tag, - newMethod(owner, name, desc, - tag == Opcodes.H_INVOKEINTERFACE)); + newMethod(owner, name, desc, itf)); } result = new Item(index++, key4); put(result); @@ -1213,7 +1214,7 @@ Item newHandleItem(final int tag, final String owner, final String name, * if the constant pool already contains a similar item. This method is * intended for {@link Attribute} sub classes, and is normally not needed by * class generators or adapters. - * + * * @param tag * the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, @@ -1230,18 +1231,52 @@ Item newHandleItem(final int tag, final String owner, final String name, * the descriptor of the field or method. * @return the index of a new or already existing method type reference * item. + * + * @deprecated this method is superseded by + * {@link #newHandle(int, String, String, String, boolean)}. */ + @Deprecated public int newHandle(final int tag, final String owner, final String name, final String desc) { - return newHandleItem(tag, owner, name, desc).index; + return newHandle(tag, owner, name, desc, tag == Opcodes.H_INVOKEINTERFACE); } + /** + * Adds a handle to the constant pool of the class being build. Does nothing + * if the constant pool already contains a similar item. This method is + * intended for {@link Attribute} sub classes, and is normally not needed by + * class generators or adapters. + * + * @param tag + * the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, + * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, + * {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, + * {@link Opcodes#H_INVOKESTATIC}, + * {@link Opcodes#H_INVOKESPECIAL}, + * {@link Opcodes#H_NEWINVOKESPECIAL} or + * {@link Opcodes#H_INVOKEINTERFACE}. + * @param owner + * the internal name of the field or method owner class. + * @param name + * the name of the field or method. + * @param desc + * the descriptor of the field or method. + * @param itf + * true if the owner is an interface. + * @return the index of a new or already existing method type reference + * item. + */ + public int newHandle(final int tag, final String owner, final String name, + final String desc, final boolean itf) { + return newHandleItem(tag, owner, name, desc, itf).index; + } + /** * Adds an invokedynamic reference to the constant pool of the class being * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param name * name of the invoked method. * @param desc @@ -1250,7 +1285,7 @@ public int newHandle(final int tag, final String owner, final String name, * the bootstrap method. * @param bsmArgs * the bootstrap method constant arguments. - * + * * @return a new or an already existing invokedynamic type reference item. */ Item newInvokeDynamicItem(final String name, final String desc, @@ -1265,7 +1300,7 @@ Item newInvokeDynamicItem(final String name, final String desc, int hashCode = bsm.hashCode(); bootstrapMethods.putShort(newHandle(bsm.tag, bsm.owner, bsm.name, - bsm.desc)); + bsm.desc, bsm.isInterface())); int argsLength = bsmArgs.length; bootstrapMethods.putShort(argsLength); @@ -1325,7 +1360,7 @@ Item newInvokeDynamicItem(final String name, final String desc, * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param name * name of the invoked method. * @param desc @@ -1334,7 +1369,7 @@ Item newInvokeDynamicItem(final String name, final String desc, * the bootstrap method. * @param bsmArgs * the bootstrap method constant arguments. - * + * * @return the index of a new or already existing invokedynamic reference * item. */ @@ -1346,7 +1381,7 @@ public int newInvokeDynamic(final String name, final String desc, /** * Adds a field reference to the constant pool of the class being build. * Does nothing if the constant pool already contains a similar item. - * + * * @param owner * the internal name of the field's owner class. * @param name @@ -1371,7 +1406,7 @@ Item newFieldItem(final String owner, final String name, final String desc) { * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param owner * the internal name of the field's owner class. * @param name @@ -1387,7 +1422,7 @@ public int newField(final String owner, final String name, final String desc) { /** * Adds a method reference to the constant pool of the class being build. * Does nothing if the constant pool already contains a similar item. - * + * * @param owner * the internal name of the method's owner class. * @param name @@ -1416,7 +1451,7 @@ Item newMethodItem(final String owner, final String name, * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param owner * the internal name of the method's owner class. * @param name @@ -1435,7 +1470,7 @@ public int newMethod(final String owner, final String name, /** * Adds an integer to the constant pool of the class being build. Does * nothing if the constant pool already contains a similar item. - * + * * @param value * the int value. * @return a new or already existing int item. @@ -1454,7 +1489,7 @@ Item newInteger(final int value) { /** * Adds a float to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the float value. * @return a new or already existing float item. @@ -1473,7 +1508,7 @@ Item newFloat(final float value) { /** * Adds a long to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the long value. * @return a new or already existing long item. @@ -1493,7 +1528,7 @@ Item newLong(final long value) { /** * Adds a double to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the double value. * @return a new or already existing double item. @@ -1513,7 +1548,7 @@ Item newDouble(final double value) { /** * Adds a string to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the String value. * @return a new or already existing string item. @@ -1534,7 +1569,7 @@ private Item newString(final String value) { * nothing if the constant pool already contains a similar item. This * method is intended for {@link Attribute} sub classes, and is normally not * needed by class generators or adapters. - * + * * @param name * a name. * @param desc @@ -1548,7 +1583,7 @@ public int newNameType(final String name, final String desc) { /** * Adds a name and type to the constant pool of the class being build. Does * nothing if the constant pool already contains a similar item. - * + * * @param name * a name. * @param desc @@ -1569,7 +1604,7 @@ Item newNameTypeItem(final String name, final String desc) { /** * Adds the given internal name to {@link #typeTable} and returns its index. * Does nothing if the type table already contains this internal name. - * + * * @param type * the internal name to be added to the type table. * @return the index of this internal name in the type table. @@ -1587,7 +1622,7 @@ int addType(final String type) { * Adds the given "uninitialized" type to {@link #typeTable} and returns its * index. This method is used for UNINITIALIZED types, made of an internal * name and a bytecode offset. - * + * * @param type * the internal name to be added to the type table. * @param offset @@ -1609,7 +1644,7 @@ int addUninitializedType(final String type, final int offset) { /** * Adds the given Item to {@link #typeTable}. - * + * * @param item * the value to be added to the type table. * @return the added Item, which a new Item instance with the same value as @@ -1636,7 +1671,7 @@ private Item addType(final Item item) { * method calls {@link #getCommonSuperClass} and caches the result in the * {@link #items} hash table to speedup future calls with the same * parameters. - * + * * @param type1 * index of an internal name in {@link #typeTable}. * @param type2 @@ -1666,7 +1701,7 @@ int getMergedType(final int type1, final int type2) { * without actually loading any class, or to take into account the class * that is currently being generated by this ClassWriter, which can of * course not be loaded since it is under construction. - * + * * @param type1 * the internal name of a class. * @param type2 @@ -1702,7 +1737,7 @@ protected String getCommonSuperClass(final String type1, final String type2) { /** * Returns the constant pool's hash table item which is equal to the given * item. - * + * * @param key * a constant pool item. * @return the constant pool's hash table item which is equal to the given @@ -1719,7 +1754,7 @@ private Item get(final Item key) { /** * Puts the given item in the constant pool's hash table. The hash table * must not already contains this item. - * + * * @param i * the item to be added to the constant pool's hash table. */ @@ -1746,26 +1781,9 @@ private void put(final Item i) { items[index] = i; } - /** - * Returns the item with a specific index. - * - * @param index - * the index of the searched item. - * @return the item with the given index. - */ - public Item findItemByIndex(int index) { - for (Item item : items) { - while (item != null) { - if (item.index == index) return item; - item = item.next; - } - } - return null; - } - /** * Puts one byte and two shorts into the constant pool. - * + * * @param b * a byte. * @param s1 @@ -1779,7 +1797,7 @@ private void put122(final int b, final int s1, final int s2) { /** * Puts two bytes and one short into the constant pool. - * + * * @param b1 * a byte. * @param b2 diff --git a/src/main/java/scala/tools/asm/Context.java b/src/main/java/scala/tools/asm/Context.java index 2454696..2702784 100644 --- a/src/main/java/scala/tools/asm/Context.java +++ b/src/main/java/scala/tools/asm/Context.java @@ -28,11 +28,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * Information about a class being parsed in a {@link ClassReader}. - * + * * @author Eric Bruneton */ class Context { @@ -142,4 +142,4 @@ class Context { * The stack values of the latest stack map frame that has been parsed. */ Object[] stack; -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/CustomAttr.java b/src/main/java/scala/tools/asm/CustomAttr.java deleted file mode 100644 index 5ecfd28..0000000 --- a/src/main/java/scala/tools/asm/CustomAttr.java +++ /dev/null @@ -1,20 +0,0 @@ -/* NSC -- new Scala compiler - * Copyright 2005-2012 LAMP/EPFL - */ - -package scala.tools.asm; - -import scala.tools.asm.Attribute; - -/** - * A subclass of ASM's Attribute for the sole purpose of accessing a protected field there. - * - */ -public class CustomAttr extends Attribute { - - public CustomAttr(final String type, final byte[] value) { - super(type); - super.value = value; - } - -} diff --git a/src/main/java/scala/tools/asm/Edge.java b/src/main/java/scala/tools/asm/Edge.java index daac1f7..4e87cba 100644 --- a/src/main/java/scala/tools/asm/Edge.java +++ b/src/main/java/scala/tools/asm/Edge.java @@ -27,11 +27,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * An edge in the control flow graph of a method body. See {@link Label Label}. - * + * * @author Eric Bruneton */ class Edge { diff --git a/src/main/java/scala/tools/asm/FieldVisitor.java b/src/main/java/scala/tools/asm/FieldVisitor.java index 708c1d3..2372e4c 100644 --- a/src/main/java/scala/tools/asm/FieldVisitor.java +++ b/src/main/java/scala/tools/asm/FieldVisitor.java @@ -27,13 +27,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A visitor to visit a Java field. The methods of this class must be called in * the following order: ( visitAnnotation | * visitTypeAnnotation | visitAttribute )* visitEnd. - * + * * @author Eric Bruneton */ public abstract class FieldVisitor { @@ -52,7 +52,7 @@ public abstract class FieldVisitor { /** * Constructs a new {@link FieldVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -63,7 +63,7 @@ public FieldVisitor(final int api) { /** * Constructs a new {@link FieldVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -81,7 +81,7 @@ public FieldVisitor(final int api, final FieldVisitor fv) { /** * Visits an annotation of the field. - * + * * @param desc * the class descriptor of the annotation class. * @param visible @@ -98,7 +98,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) { /** * Visits an annotation on the type of the field. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#FIELD FIELD}. See @@ -127,7 +127,7 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef, /** * Visits a non standard attribute of the field. - * + * * @param attr * an attribute. */ diff --git a/src/main/java/scala/tools/asm/FieldWriter.java b/src/main/java/scala/tools/asm/FieldWriter.java index e640a8d..84d92aa 100644 --- a/src/main/java/scala/tools/asm/FieldWriter.java +++ b/src/main/java/scala/tools/asm/FieldWriter.java @@ -27,11 +27,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * An {@link FieldVisitor} that generates Java fields in bytecode form. - * + * * @author Eric Bruneton */ final class FieldWriter extends FieldVisitor { @@ -102,7 +102,7 @@ final class FieldWriter extends FieldVisitor { /** * Constructs a new {@link FieldWriter}. - * + * * @param cw * the class writer to which this field must be added. * @param access @@ -200,7 +200,7 @@ public void visitEnd() { /** * Returns the size of this field. - * + * * @return the size of this field. */ int getSize() { @@ -248,7 +248,7 @@ int getSize() { /** * Puts the content of this field into the given byte vector. - * + * * @param out * where the content of this field must be put. */ diff --git a/src/main/java/scala/tools/asm/Frame.java b/src/main/java/scala/tools/asm/Frame.java index 85ad326..1f6106f 100644 --- a/src/main/java/scala/tools/asm/Frame.java +++ b/src/main/java/scala/tools/asm/Frame.java @@ -27,11 +27,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * Information about the input and output stack map frames of a basic block. - * + * * @author Eric Bruneton */ final class Frame { @@ -46,14 +46,14 @@ final class Frame { * of the first basic block (which is computed from the method descriptor), * and by using the previously computed output frames to compute the input * state of the other blocks. - * + * * All output and input frames are stored as arrays of integers. Reference * and array types are represented by an index into a type table (which is * not the same as the constant pool of the class, in order to avoid adding * unnecessary constants in the pool - not all computed frames will end up * being stored in the stack map table). This allows very fast type * comparisons. - * + * * Output stack map frames are computed relatively to the input frame of the * basic block, which is not yet known when output frames are computed. It * is therefore necessary to be able to represent abstract types such as @@ -61,7 +61,7 @@ final class Frame { * position x from the top of the input frame stack" or even "the type at * position x in the input frame, with y more (or less) array dimensions". * This explains the rather complicated type format used in output frames. - * + * * This format is the following: DIM KIND VALUE (4, 4 and 24 bits). DIM is a * signed number of array dimensions (from -8 to 7). KIND is either BASE, * LOCAL or STACK. BASE is used for types that are not relative to the input @@ -72,14 +72,14 @@ final class Frame { * relatively to the top of input frame stack. For BASE types, it is either * one of the constants defined below, or for OBJECT and UNINITIALIZED * types, a tag and an index in the type table. - * + * * Output frames can contain types of any kind and with a positive or * negative dimension (and even unassigned types, represented by 0 - which * does not correspond to any valid type value). Input frames can only * contain BASE types of positive or null dimension. In all cases the type * table contains only internal type names (array type descriptors are * forbidden - dimensions must be represented through the DIM field). - * + * * The LONG and DOUBLE types are always represented by using two slots (LONG * + TOP or DOUBLE + TOP), for local variable types as well as in the * operand stack. This is necessary to be able to simulate DUPx_y @@ -107,7 +107,7 @@ final class Frame { /** * Mask to get the kind of a frame type. - * + * * @see #BASE * @see #LOCAL * @see #STACK @@ -489,10 +489,10 @@ final class Frame { /** * Relative size of the output stack. The exact semantics of this field * depends on the algorithm that is used. - * + * * When only the maximum stack size is computed, this field is the size of * the output stack relatively to the top of the input stack. - * + * * When the stack map frames are completely computed, this field is the * actual number of types in {@link #outputStack}. */ @@ -500,7 +500,7 @@ final class Frame { /** * Number of types that are initialized in the basic block. - * + * * @see #initializations */ private int initializationCount; @@ -522,7 +522,7 @@ final class Frame { /** * Returns the output frame local variable type at the given index. - * + * * @param local * the index of the local that must be returned. * @return the output frame local variable type at the given index. @@ -545,7 +545,7 @@ private int get(final int local) { /** * Sets the output frame local variable type at the given index. - * + * * @param local * the index of the local that must be set. * @param type @@ -568,7 +568,7 @@ private void set(final int local, final int type) { /** * Pushes a new type onto the output frame stack. - * + * * @param type * the type that must be pushed. */ @@ -594,7 +594,7 @@ private void push(final int type) { /** * Pushes a new type onto the output frame stack. - * + * * @param cw * the ClassWriter to which this label belongs. * @param desc @@ -614,7 +614,7 @@ private void push(final ClassWriter cw, final String desc) { /** * Returns the int encoding of the given type. - * + * * @param cw * the ClassWriter to which this label belongs. * @param desc @@ -688,7 +688,7 @@ private static int type(final ClassWriter cw, final String desc) { /** * Pops a type from the output frame stack and returns its value. - * + * * @return the type that has been popped from the output frame stack. */ private int pop() { @@ -702,7 +702,7 @@ private int pop() { /** * Pops the given number of types from the output frame stack. - * + * * @param elements * the number of types that must be popped. */ @@ -720,7 +720,7 @@ private void pop(final int elements) { /** * Pops a type from the output frame stack. - * + * * @param desc * the descriptor of the type to be popped. Can also be a method * descriptor (in this case this method pops the types @@ -740,7 +740,7 @@ private void pop(final String desc) { /** * Adds a new type to the list of types on which a constructor is invoked in * the basic block. - * + * * @param var * a type on a which a constructor is invoked. */ @@ -762,7 +762,7 @@ private void init(final int var) { /** * Replaces the given type with the appropriate type if it is one of the * types on which a constructor is invoked in the basic block. - * + * * @param cw * the ClassWriter to which this label belongs. * @param t @@ -799,7 +799,7 @@ private int init(final ClassWriter cw, final int t) { /** * Initializes the input frame of the first basic block from the method * descriptor. - * + * * @param cw * the ClassWriter to which this label belongs. * @param access @@ -835,7 +835,7 @@ void initInputFrame(final ClassWriter cw, final int access, /** * Simulates the action of the given instruction on the output stack frame. - * + * * @param opcode * the opcode of the instruction. * @param arg @@ -1272,7 +1272,7 @@ void execute(final int opcode, final int arg, final ClassWriter cw, * Merges the input frame of the given basic block with the input and output * frames of this basic block. Returns true if the input frame of * the given label has been changed by this operation. - * + * * @param cw * the ClassWriter to which this label belongs. * @param frame @@ -1380,7 +1380,7 @@ boolean merge(final ClassWriter cw, final Frame frame, final int edge) { * Merges the type at the given index in the given type array with the given * type. Returns true if the type array has been modified by this * operation. - * + * * @param cw * the ClassWriter to which this label belongs. * @param t diff --git a/src/main/java/scala/tools/asm/Handle.java b/src/main/java/scala/tools/asm/Handle.java index cf12bb7..ddc0368 100644 --- a/src/main/java/scala/tools/asm/Handle.java +++ b/src/main/java/scala/tools/asm/Handle.java @@ -28,11 +28,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A reference to a field or a method. - * + * * @author Remi Forax * @author Eric Bruneton */ @@ -63,10 +63,16 @@ public final class Handle { * The descriptor of the field or method designated by this handle. */ final String desc; + + + /** + * Indicate if the owner is an interface or not. + */ + final boolean itf; /** * Constructs a new field or method handle. - * + * * @param tag * the kind of field or method designated by this Handle. Must be * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, @@ -84,17 +90,49 @@ public final class Handle { * @param desc * the descriptor of the field or method designated by this * handle. + * + * @deprecated this constructor has been superseded + * by {@link #Handle(int, String, String, String, boolean)}. */ + @Deprecated public Handle(int tag, String owner, String name, String desc) { + this(tag, owner, name, desc, tag == Opcodes.H_INVOKEINTERFACE); + } + + /** + * Constructs a new field or method handle. + * + * @param tag + * the kind of field or method designated by this Handle. Must be + * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, + * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, + * {@link Opcodes#H_INVOKEVIRTUAL}, + * {@link Opcodes#H_INVOKESTATIC}, + * {@link Opcodes#H_INVOKESPECIAL}, + * {@link Opcodes#H_NEWINVOKESPECIAL} or + * {@link Opcodes#H_INVOKEINTERFACE}. + * @param owner + * the internal name of the class that owns the field or method + * designated by this handle. + * @param name + * the name of the field or method designated by this handle. + * @param desc + * the descriptor of the field or method designated by this + * handle. + * @param itf + * true if the owner is an interface. + */ + public Handle(int tag, String owner, String name, String desc, boolean itf) { this.tag = tag; this.owner = owner; this.name = name; this.desc = desc; + this.itf = itf; } - + /** * Returns the kind of field or method designated by this handle. - * + * * @return {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, * {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC}, @@ -109,7 +147,7 @@ public int getTag() { /** * Returns the internal name of the class that owns the field or method * designated by this handle. - * + * * @return the internal name of the class that owns the field or method * designated by this handle. */ @@ -119,7 +157,7 @@ public String getOwner() { /** * Returns the name of the field or method designated by this handle. - * + * * @return the name of the field or method designated by this handle. */ public String getName() { @@ -128,12 +166,23 @@ public String getName() { /** * Returns the descriptor of the field or method designated by this handle. - * + * * @return the descriptor of the field or method designated by this handle. */ public String getDesc() { return desc; } + + /** + * Returns true if the owner of the field or method designated + * by this handle is an interface. + * + * @return true if the owner of the field or method designated + * by this handle is an interface. + */ + public boolean isInterface() { + return itf; + } @Override public boolean equals(Object obj) { @@ -144,27 +193,30 @@ public boolean equals(Object obj) { return false; } Handle h = (Handle) obj; - return tag == h.tag && owner.equals(h.owner) && name.equals(h.name) - && desc.equals(h.desc); + return tag == h.tag && itf == h.itf && owner.equals(h.owner) + && name.equals(h.name) && desc.equals(h.desc); } @Override public int hashCode() { - return tag + owner.hashCode() * name.hashCode() * desc.hashCode(); + return tag + (itf? 64: 0) + owner.hashCode() * name.hashCode() * desc.hashCode(); } /** * Returns the textual representation of this handle. The textual * representation is: - * + * *
+     * for a reference to a class:
      * owner '.' name desc ' ' '(' tag ')'
+     * for a reference to an interface:
+     * owner '.' name desc ' ' '(' tag ' ' itf ')'
      * 
- * + * * . As this format is unambiguous, it can be parsed if necessary. */ @Override public String toString() { - return owner + '.' + name + desc + " (" + tag + ')'; + return owner + '.' + name + desc + " (" + tag + (itf? " itf": "") + ')'; } } diff --git a/src/main/java/scala/tools/asm/Handler.java b/src/main/java/scala/tools/asm/Handler.java index a06cb81..b24591d 100644 --- a/src/main/java/scala/tools/asm/Handler.java +++ b/src/main/java/scala/tools/asm/Handler.java @@ -27,11 +27,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * Information about an exception handler block. - * + * * @author Eric Bruneton */ class Handler { @@ -71,7 +71,7 @@ class Handler { /** * Removes the range between start and end from the given exception * handlers. - * + * * @param h * an exception handler list. * @param start diff --git a/src/main/java/scala/tools/asm/Item.java b/src/main/java/scala/tools/asm/Item.java index 4cf78bf..917524d 100644 --- a/src/main/java/scala/tools/asm/Item.java +++ b/src/main/java/scala/tools/asm/Item.java @@ -27,12 +27,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A constant pool item. Constant pool items can be created with the 'newXXX' * methods in the {@link ClassWriter} class. - * + * * @author Eric Bruneton */ final class Item { @@ -52,11 +52,11 @@ final class Item { * {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD}, * {@link ClassWriter#METH}, {@link ClassWriter#IMETH}, * {@link ClassWriter#MTYPE}, {@link ClassWriter#INDY}. - * + * * MethodHandle constant 9 variations are stored using a range of 9 values * from {@link ClassWriter#HANDLE_BASE} + 1 to * {@link ClassWriter#HANDLE_BASE} + 9. - * + * * Special Item types are used for Items that are stored in the ClassWriter * {@link ClassWriter#typeTable}, instead of the constant pool, in order to * avoid clashes with normal constant pool items in the ClassWriter constant @@ -114,7 +114,7 @@ final class Item { /** * Constructs an uninitialized {@link Item} for constant pool element at * given position. - * + * * @param index * index of the item to be constructed. */ @@ -124,7 +124,7 @@ final class Item { /** * Constructs a copy of the given item. - * + * * @param index * index of the item to be constructed. * @param i @@ -143,7 +143,7 @@ final class Item { /** * Sets this item to an integer item. - * + * * @param intVal * the value of this item. */ @@ -155,7 +155,7 @@ void set(final int intVal) { /** * Sets this item to a long item. - * + * * @param longVal * the value of this item. */ @@ -167,7 +167,7 @@ void set(final long longVal) { /** * Sets this item to a float item. - * + * * @param floatVal * the value of this item. */ @@ -179,7 +179,7 @@ void set(final float floatVal) { /** * Sets this item to a double item. - * + * * @param doubleVal * the value of this item. */ @@ -191,7 +191,7 @@ void set(final double doubleVal) { /** * Sets this item to an item that do not hold a primitive value. - * + * * @param type * the type of this item. * @param strVal1 @@ -234,7 +234,7 @@ void set(final int type, final String strVal1, final String strVal2, /** * Sets the item to an InvokeDynamic item. - * + * * @param name * invokedynamic's name. * @param desc @@ -253,7 +253,7 @@ void set(String name, String desc, int bsmIndex) { /** * Sets the item to a BootstrapMethod item. - * + * * @param position * position in byte in the class attribute BootrapMethods. * @param hashCode @@ -270,7 +270,7 @@ void set(int position, int hashCode) { /** * Indicates if the given item is equal to this one. This method assumes * that the two items have the same {@link #type}. - * + * * @param i * the item to be compared to this one. Both items must have the * same {@link #type}. diff --git a/src/main/java/scala/tools/asm/Label.java b/src/main/java/scala/tools/asm/Label.java index 7c8fd9e..6bca6fb 100644 --- a/src/main/java/scala/tools/asm/Label.java +++ b/src/main/java/scala/tools/asm/Label.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A label represents a position in the bytecode of a method. Labels are used @@ -35,7 +35,7 @@ * designates the instruction that is just after. Note however that there * can be other elements between a label and the instruction it designates (such * as other labels, stack map frames, line numbers, etc.). - * + * * @author Eric Bruneton */ public class Label { @@ -111,13 +111,13 @@ public class Label { * Field used to associate user information to a label. Warning: this field * is used by the ASM tree package. In order to use it with the ASM tree * package you must override the - * {@link scala.tools.asm.tree.MethodNode#getLabelNode} method. + * {@link org.objectweb.asm.tree.MethodNode#getLabelNode} method. */ public Object info; /** * Flags that indicate the status of this label. - * + * * @see #DEBUG * @see #RESOLVED * @see #RESIZED @@ -174,7 +174,7 @@ public class Label { * represented by the Label object that corresponds to the first instruction * of this basic block. Each node also stores the list of its successors in * the graph, as a linked list of Edge objects. - * + * * The control flow analysis algorithms used to compute the maximum stack * size or the stack map frames are similar and use two steps. The first * step, during the visit of each instruction, builds information about the @@ -186,7 +186,7 @@ public class Label { * information about the input frame of each basic block, from the input * state of the first basic block (known from the method signature), and by * the using the previously computed relative output frames. - * + * * The algorithm used to compute the maximum stack size only computes the * relative output and absolute input stack heights, while the algorithm * used to compute stack map frames computes relative output frames and @@ -196,10 +196,10 @@ public class Label { /** * Start of the output stack relatively to the input stack. The exact * semantics of this field depends on the algorithm that is used. - * + * * When only the maximum stack size is computed, this field is the number of * elements in the input stack. - * + * * When the stack map frames are completely computed, this field is the * offset of the first output stack element relatively to the top of the * input stack. This offset is always negative or null. A null offset means @@ -243,9 +243,9 @@ public class Label { * The next basic block in the basic block stack. This stack is used in the * main loop of the fix point algorithm used in the second step of the * control flow analysis algorithms. It is also used in - * {@link #visitSubroutine} to avoid using a recursive method, and in - * ClassReader to temporarily store multiple source lines for a label. - * + * {@link #visitSubroutine} to avoid using a recursive method, and in + * ClassReader to temporarily store multiple source lines for a label. + * * @see MethodWriter#visitMaxs */ Label next; @@ -269,7 +269,7 @@ public Label() { * from the start of the method's bytecode. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @return the offset corresponding to this label. * @throws IllegalStateException * if this label is not resolved yet. @@ -287,7 +287,7 @@ public int getOffset() { * position of the label is known, the offset is computed and written * directly. Otherwise, a null offset is written and a new forward reference * is declared for this label. - * + * * @param owner * the code writer that calls this method. * @param out @@ -325,7 +325,7 @@ void put(final MethodWriter owner, final ByteVector out, final int source, * for a true forward reference, i.e. only if this label is not resolved * yet. For backward references, the offset of the reference can be, and * must be, computed and stored directly. - * + * * @param sourcePosition * the position of the referencing instruction. This position * will be used to compute the offset of this forward reference. @@ -353,7 +353,7 @@ private void addReference(final int sourcePosition, * when this label is added to the bytecode of the method, i.e. when its * position becomes known. This method fills in the blanks that where left * in the bytecode by each forward reference previously added to this label. - * + * * @param owner * the code writer that calls this method. * @param position @@ -421,7 +421,7 @@ boolean resolve(final MethodWriter owner, final int position, * isolated label or for the first label in a series of successive labels, * this method returns the label itself. For other labels it returns the * first label of the series. - * + * * @return the first label of the series to which this label belongs. */ Label getFirst() { @@ -434,7 +434,7 @@ Label getFirst() { /** * Returns true is this basic block belongs to the given subroutine. - * + * * @param id * a subroutine id. * @return true is this basic block belongs to the given subroutine. @@ -449,7 +449,7 @@ boolean inSubroutine(final long id) { /** * Returns true if this basic block and the given one belong to a common * subroutine. - * + * * @param block * another basic block. * @return true if this basic block and the given one belong to a common @@ -469,7 +469,7 @@ boolean inSameSubroutine(final Label block) { /** * Marks this basic block as belonging to the given subroutine. - * + * * @param id * a subroutine id. * @param nbSubroutines @@ -488,7 +488,7 @@ void addToSubroutine(final long id, final int nbSubroutines) { * blocks as belonging to this subroutine. This method follows the control * flow graph to find all the blocks that are reachable from the current * block WITHOUT following any JSR target. - * + * * @param JSR * a JSR block that jumps to this subroutine. If this JSR is not * null it is added to the successor of the RET blocks found in @@ -550,12 +550,12 @@ void visitSubroutine(final Label JSR, final long id, final int nbSubroutines) { } // ------------------------------------------------------------------------ - // Overridden Object methods + // Overriden Object methods // ------------------------------------------------------------------------ /** * Returns a string representation of this label. - * + * * @return a string representation of this label. */ @Override diff --git a/src/main/java/scala/tools/asm/MethodVisitor.java b/src/main/java/scala/tools/asm/MethodVisitor.java index fc1e1df..f0927e8 100644 --- a/src/main/java/scala/tools/asm/MethodVisitor.java +++ b/src/main/java/scala/tools/asm/MethodVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A visitor to visit a Java method. The methods of this class must be called in @@ -50,7 +50,7 @@ * visitLocalVariable, visitLocalVariableAnnotation and * visitLineNumber methods must be called after the labels * passed as arguments have been visited. - * + * * @author Eric Bruneton */ public abstract class MethodVisitor { @@ -69,7 +69,7 @@ public abstract class MethodVisitor { /** * Constructs a new {@link MethodVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -80,7 +80,7 @@ public MethodVisitor(final int api) { /** * Constructs a new {@link MethodVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -102,7 +102,7 @@ public MethodVisitor(final int api, final MethodVisitor mv) { /** * Visits a parameter of this method. - * + * * @param name * parameter name or null if none is provided. * @param access @@ -121,7 +121,7 @@ public void visitParameter(String name, int access) { /** * Visits the default value of this annotation interface method. - * + * * @return a visitor to the visit the actual default value of this * annotation interface method, or null if this visitor is * not interested in visiting this default value. The 'name' @@ -138,7 +138,7 @@ public AnnotationVisitor visitAnnotationDefault() { /** * Visits an annotation of this method. - * + * * @param desc * the class descriptor of the annotation class. * @param visible @@ -155,7 +155,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) { /** * Visits an annotation on a type in the method signature. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#METHOD_TYPE_PARAMETER @@ -191,7 +191,7 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef, /** * Visits an annotation of a parameter this method. - * + * * @param parameter * the parameter index. * @param desc @@ -211,7 +211,7 @@ public AnnotationVisitor visitParameterAnnotation(int parameter, /** * Visits a non standard attribute of this method. - * + * * @param attr * an attribute. */ @@ -272,7 +272,7 @@ public void visitCode() { * and access flags, is implicit and must not be visited. Also, it is * illegal to visit two or more frames for the same code location (i.e., at * least one instruction must be visited between two calls to visitFrame). - * + * * @param type * the type of this stack map frame. Must be * {@link Opcodes#F_NEW} for expanded frames, or @@ -318,7 +318,7 @@ public void visitFrame(int type, int nLocal, Object[] local, int nStack, /** * Visits a zero operand instruction. - * + * * @param opcode * the opcode of the instruction to be visited. This opcode is * either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, @@ -344,7 +344,7 @@ public void visitInsn(int opcode) { /** * Visits an instruction with a single int operand. - * + * * @param opcode * the opcode of the instruction to be visited. This opcode is * either BIPUSH, SIPUSH or NEWARRAY. @@ -369,7 +369,7 @@ public void visitIntInsn(int opcode, int operand) { /** * Visits a local variable instruction. A local variable instruction is an * instruction that loads or stores the value of a local variable. - * + * * @param opcode * the opcode of the local variable instruction to be visited. * This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, @@ -387,7 +387,7 @@ public void visitVarInsn(int opcode, int var) { /** * Visits a type instruction. A type instruction is an instruction that * takes the internal name of a class as parameter. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF. @@ -405,7 +405,7 @@ public void visitTypeInsn(int opcode, String type) { /** * Visits a field instruction. A field instruction is an instruction that * loads or stores the value of a field of an object. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. @@ -427,7 +427,7 @@ public void visitFieldInsn(int opcode, String owner, String name, /** * Visits a method instruction. A method instruction is an instruction that * invokes a method. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or @@ -456,7 +456,7 @@ public void visitMethodInsn(int opcode, String owner, String name, /** * Visits a method instruction. A method instruction is an instruction that * invokes a method. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or @@ -488,7 +488,7 @@ public void visitMethodInsn(int opcode, String owner, String name, /** * Visits an invokedynamic instruction. - * + * * @param name * the method's name. * @param desc @@ -512,7 +512,7 @@ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, /** * Visits a jump instruction. A jump instruction is an instruction that may * jump to another instruction. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, @@ -532,7 +532,7 @@ public void visitJumpInsn(int opcode, Label label) { /** * Visits a label. A label designates the instruction that will be visited * just after it. - * + * * @param label * a {@link Label Label} object. */ @@ -551,7 +551,7 @@ public void visitLabel(Label label) { * future versions of the Java Virtual Machine. To easily detect new * constant types, implementations of this method should check for * unexpected constant types, like this: - * + * *
      * if (cst instanceof Integer) {
      *     // ...
@@ -580,7 +580,7 @@ public void visitLabel(Label label) {
      *     // throw an exception
      * }
      * 
- * + * * @param cst * the constant to be loaded on the stack. This parameter must be * a non null {@link Integer}, a {@link Float}, a {@link Long}, a @@ -598,7 +598,7 @@ public void visitLdcInsn(Object cst) { /** * Visits an IINC instruction. - * + * * @param var * index of the local variable to be incremented. * @param increment @@ -612,7 +612,7 @@ public void visitIincInsn(int var, int increment) { /** * Visits a TABLESWITCH instruction. - * + * * @param min * the minimum key value. * @param max @@ -632,7 +632,7 @@ public void visitTableSwitchInsn(int min, int max, Label dflt, /** * Visits a LOOKUPSWITCH instruction. - * + * * @param dflt * beginning of the default handler block. * @param keys @@ -649,7 +649,7 @@ public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) { /** * Visits a MULTIANEWARRAY instruction. - * + * * @param desc * an array type descriptor (see {@link Type Type}). * @param dims @@ -665,7 +665,7 @@ public void visitMultiANewArrayInsn(String desc, int dims) { * Visits an annotation on an instruction. This method must be called just * after the annotated instruction. It can be called several times * for the same instruction. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#INSTANCEOF INSTANCEOF}, @@ -709,7 +709,7 @@ public AnnotationVisitor visitInsnAnnotation(int typeRef, /** * Visits a try catch block. - * + * * @param start * beginning of the exception handler's scope (inclusive). * @param end @@ -736,7 +736,7 @@ public void visitTryCatchBlock(Label start, Label end, Label handler, * called after the {@link #visitTryCatchBlock} for the annotated * exception handler. It can be called several times for the same exception * handler. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#EXCEPTION_PARAMETER @@ -765,7 +765,7 @@ public AnnotationVisitor visitTryCatchAnnotation(int typeRef, /** * Visits a local variable declaration. - * + * * @param name * the name of a local variable. * @param desc @@ -795,7 +795,7 @@ public void visitLocalVariable(String name, String desc, String signature, /** * Visits an annotation on a local variable type. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#LOCAL_VARIABLE @@ -837,7 +837,7 @@ public AnnotationVisitor visitLocalVariableAnnotation(int typeRef, /** * Visits a line number declaration. - * + * * @param line * a line number. This number refers to the source file from * which the class was compiled. @@ -856,7 +856,7 @@ public void visitLineNumber(int line, Label start) { /** * Visits the maximum stack size and the maximum number of local variables * of the method. - * + * * @param maxStack * maximum stack size of the method. * @param maxLocals diff --git a/src/main/java/scala/tools/asm/MethodWriter.java b/src/main/java/scala/tools/asm/MethodWriter.java index ee54c4c..5d30ddc 100644 --- a/src/main/java/scala/tools/asm/MethodWriter.java +++ b/src/main/java/scala/tools/asm/MethodWriter.java @@ -27,17 +27,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A {@link MethodVisitor} that generates methods in bytecode form. Each visit * method of this class appends the bytecode corresponding to the visited * instruction to a byte vector, in the order these methods are called. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ -public class MethodWriter extends MethodVisitor { +class MethodWriter extends MethodVisitor { /** * Pseudo access flag used to denote constructors. @@ -96,7 +96,7 @@ public class MethodWriter extends MethodVisitor { * Indicates that the stack map frames must be recomputed from scratch. In * this case the maximum stack size and number of local variables is also * recomputed from scratch. - * + * * @see #compute */ private static final int FRAMES = 0; @@ -104,14 +104,14 @@ public class MethodWriter extends MethodVisitor { /** * Indicates that the maximum stack size and number of local variables must * be automatically computed. - * + * * @see #compute */ private static final int MAXS = 1; /** * Indicates that nothing must be automatically computed. - * + * * @see #compute */ private static final int NOTHING = 2; @@ -235,19 +235,11 @@ public class MethodWriter extends MethodVisitor { */ private int maxStack; - public int getMaxStack() { - return maxStack; - } - /** * Maximum number of local variables for this method. */ private int maxLocals; - public int getMaxLocals() { - return maxLocals; - } - /** * Number of local variables in the current stack map frame. */ @@ -271,7 +263,7 @@ public int getMaxLocals() { /** * The last frame that was written in the StackMapTable attribute. - * + * * @see #frame */ private int[] previousFrame; @@ -386,7 +378,7 @@ public int getMaxLocals() { /** * Indicates what must be automatically computed. - * + * * @see #FRAMES * @see #MAXS * @see #NOTHING @@ -436,7 +428,7 @@ public int getMaxLocals() { /** * Constructs a new {@link MethodWriter}. - * + * * @param cw * the class writer in which the method must be added. * @param access @@ -1665,7 +1657,7 @@ public void visitEnd() { /** * Adds a successor to the {@link #currentBlock currentBlock} block. - * + * * @param info * information about the control flow edge to be added. * @param successor @@ -1705,7 +1697,7 @@ private void noSuccessor() { /** * Visits a frame that has been computed from scratch. - * + * * @param f * the frame that must be visited. */ @@ -1821,7 +1813,7 @@ private void visitImplicitFirstFrame() { /** * Starts the visit of a stack map frame. - * + * * @param offset * the offset of the instruction to which the frame corresponds. * @param nLocal @@ -1950,7 +1942,7 @@ private void writeFrame() { * StackMapTableAttribute. This method converts types from the format used * in {@link Label} to the format used in StackMapTable attributes. In * particular, it converts type table indexes to constant pool indexes. - * + * * @param start * index of the first type in {@link #frame} to write. * @param end @@ -2031,7 +2023,7 @@ private void writeFrameType(final Object type) { /** * Returns the size of the bytecode of this method. - * + * * @return the size of the bytecode of this method. */ final int getSize() { @@ -2040,11 +2032,8 @@ final int getSize() { } int size = 8; if (code.length > 0) { - if (code.length > 65536) { - String nameString = ""; - Item nameItem = cw.findItemByIndex(name); - if (nameItem != null) nameString = nameItem.strVal1 +"'s "; - throw new RuntimeException("Method "+ nameString +"code too large!"); + if (code.length > 65535) { + throw new RuntimeException("Method code too large!"); } cw.newUTF8("Code"); size += 18 + code.length + 8 * handlerCount; @@ -2144,7 +2133,7 @@ final int getSize() { /** * Puts the bytecode of this method in the given byte vector. - * + * * @param out * the byte vector into which the bytecode of this method must be * copied. @@ -2390,17 +2379,17 @@ private void resizeInstructions() { * so on. The first step of the algorithm consists in finding all the * instructions that need to be resized, without modifying the code. * This is done by the following "fix point" algorithm: - * + * * Parse the code to find the jump instructions whose offset will need * more than 2 bytes to be stored (the future offset is computed from * the current offset and from the number of bytes that will be inserted * or removed between the source and target instructions). For each such * instruction, adds an entry in (a copy of) the indexes and sizes * arrays (if this has not already been done in a previous iteration!). - * + * * If at least one entry has been added during the previous step, go * back to the beginning, otherwise stop. - * + * * In fact the real algorithm is complicated by the fact that the size * of TABLESWITCH and LOOKUPSWITCH instructions depends on their * position in the bytecode (because of padding). In order to ensure the @@ -2801,7 +2790,7 @@ private void resizeInstructions() { /** * Reads an unsigned short value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2814,7 +2803,7 @@ static int readUnsignedShort(final byte[] b, final int index) { /** * Reads a signed short value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2827,7 +2816,7 @@ static short readShort(final byte[] b, final int index) { /** * Reads a signed int value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2841,7 +2830,7 @@ static int readInt(final byte[] b, final int index) { /** * Writes a short value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2860,7 +2849,7 @@ static void writeShort(final byte[] b, final int index, final int s) { * Note: it is possible to have several entries for the same instruction in * the indexes and sizes: two entries (index=a,size=b) and * (index=a,size=b') are equivalent to a single entry (index=a,size=b+b'). - * + * * @param indexes * current positions of the instructions to be resized. Each * instruction must be designated by the index of its last @@ -2898,7 +2887,7 @@ static int getNewOffset(final int[] indexes, final int[] sizes, /** * Updates the offset of the given label. - * + * * @param indexes * current positions of the instructions to be resized. Each * instruction must be designated by the index of its last diff --git a/src/main/java/scala/tools/asm/Opcodes.java b/src/main/java/scala/tools/asm/Opcodes.java index 24eaffa..e5c2b33 100644 --- a/src/main/java/scala/tools/asm/Opcodes.java +++ b/src/main/java/scala/tools/asm/Opcodes.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * Defines the JVM opcodes, access flags and array type codes. This interface @@ -37,7 +37,7 @@ * opcodes are therefore not defined in this interface. Likewise for LDC, * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and * JSR_W. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ diff --git a/src/main/java/scala/tools/asm/Type.java b/src/main/java/scala/tools/asm/Type.java index c8f0048..6561fea 100644 --- a/src/main/java/scala/tools/asm/Type.java +++ b/src/main/java/scala/tools/asm/Type.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -35,7 +35,7 @@ /** * A Java field or method type. This class can be used to make it easier to * manipulate type and method descriptors. - * + * * @author Eric Bruneton * @author Chris Nokleberg */ @@ -189,7 +189,7 @@ public class Type { /** * Constructs a reference type. - * + * * @param sort * the sort of the reference type to be constructed. * @param buf @@ -208,7 +208,7 @@ private Type(final int sort, final char[] buf, final int off, final int len) { /** * Returns the Java type corresponding to the given type descriptor. - * + * * @param typeDescriptor * a field or method type descriptor. * @return the Java type corresponding to the given type descriptor. @@ -219,7 +219,7 @@ public static Type getType(final String typeDescriptor) { /** * Returns the Java type corresponding to the given internal name. - * + * * @param internalName * an internal name. * @return the Java type corresponding to the given internal name. @@ -232,7 +232,7 @@ public static Type getObjectType(final String internalName) { /** * Returns the Java type corresponding to the given method descriptor. * Equivalent to Type.getType(methodDescriptor). - * + * * @param methodDescriptor * a method descriptor. * @return the Java type corresponding to the given method descriptor. @@ -244,7 +244,7 @@ public static Type getMethodType(final String methodDescriptor) { /** * Returns the Java method type corresponding to the given argument and * return types. - * + * * @param returnType * the return type of the method. * @param argumentTypes @@ -259,7 +259,7 @@ public static Type getMethodType(final Type returnType, /** * Returns the Java type corresponding to the given class. - * + * * @param c * a class. * @return the Java type corresponding to the given class. @@ -292,7 +292,7 @@ public static Type getType(final Class c) { /** * Returns the Java method type corresponding to the given constructor. - * + * * @param c * a {@link Constructor Constructor} object. * @return the Java method type corresponding to the given constructor. @@ -303,7 +303,7 @@ public static Type getType(final Constructor c) { /** * Returns the Java method type corresponding to the given method. - * + * * @param m * a {@link Method Method} object. * @return the Java method type corresponding to the given method. @@ -315,7 +315,7 @@ public static Type getType(final Method m) { /** * Returns the Java types corresponding to the argument types of the given * method descriptor. - * + * * @param methodDescriptor * a method descriptor. * @return the Java types corresponding to the argument types of the given @@ -351,7 +351,7 @@ public static Type[] getArgumentTypes(final String methodDescriptor) { /** * Returns the Java types corresponding to the argument types of the given * method. - * + * * @param method * a method. * @return the Java types corresponding to the argument types of the given @@ -369,7 +369,7 @@ public static Type[] getArgumentTypes(final Method method) { /** * Returns the Java type corresponding to the return type of the given * method descriptor. - * + * * @param methodDescriptor * a method descriptor. * @return the Java type corresponding to the return type of the given @@ -383,7 +383,7 @@ public static Type getReturnType(final String methodDescriptor) { /** * Returns the Java type corresponding to the return type of the given * method. - * + * * @param method * a method. * @return the Java type corresponding to the return type of the given @@ -395,7 +395,7 @@ public static Type getReturnType(final Method method) { /** * Computes the size of the arguments and of the return value of a method. - * + * * @param desc * the descriptor of a method. * @return the size of the arguments of the method (plus one for the @@ -436,7 +436,7 @@ public static int getArgumentsAndReturnSizes(final String desc) { * Returns the Java type corresponding to the given type descriptor. For * method descriptors, buf is supposed to contain nothing more than the * descriptor itself. - * + * * @param buf * a buffer containing a type descriptor. * @param off @@ -494,7 +494,7 @@ private static Type getType(final char[] buf, final int off) { /** * Returns the sort of this Java type. - * + * * @return {@link #VOID VOID}, {@link #BOOLEAN BOOLEAN}, {@link #CHAR CHAR}, * {@link #BYTE BYTE}, {@link #SHORT SHORT}, {@link #INT INT}, * {@link #FLOAT FLOAT}, {@link #LONG LONG}, {@link #DOUBLE DOUBLE}, @@ -508,7 +508,7 @@ public int getSort() { /** * Returns the number of dimensions of this array type. This method should * only be used for an array type. - * + * * @return the number of dimensions of this array type. */ public int getDimensions() { @@ -522,7 +522,7 @@ public int getDimensions() { /** * Returns the type of the elements of this array type. This method should * only be used for an array type. - * + * * @return Returns the type of the elements of this array type. */ public Type getElementType() { @@ -532,7 +532,7 @@ public Type getElementType() { /** * Returns the binary name of the class corresponding to this type. This * method must not be used on method types. - * + * * @return the binary name of the class corresponding to this type. */ public String getClassName() { @@ -573,7 +573,7 @@ public String getClassName() { * array type. The internal name of a class is its fully qualified name (as * returned by Class.getName(), where '.' are replaced by '/'. This method * should only be used for an object or array type. - * + * * @return the internal name of the class corresponding to this object type. */ public String getInternalName() { @@ -583,7 +583,7 @@ public String getInternalName() { /** * Returns the argument types of methods of this type. This method should * only be used for method types. - * + * * @return the argument types of methods of this type. */ public Type[] getArgumentTypes() { @@ -593,7 +593,7 @@ public Type[] getArgumentTypes() { /** * Returns the return type of methods of this type. This method should only * be used for method types. - * + * * @return the return type of methods of this type. */ public Type getReturnType() { @@ -603,7 +603,7 @@ public Type getReturnType() { /** * Returns the size of the arguments and of the return value of methods of * this type. This method should only be used for method types. - * + * * @return the size of the arguments (plus one for the implicit this * argument), argSize, and the size of the return value, retSize, * packed into a single @@ -621,11 +621,11 @@ public int getArgumentsAndReturnSizes() { /** * Returns the descriptor corresponding to this Java type. - * + * * @return the descriptor corresponding to this Java type. */ public String getDescriptor() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); getDescriptor(buf); return buf.toString(); } @@ -633,7 +633,7 @@ public String getDescriptor() { /** * Returns the descriptor corresponding to the given argument and return * types. - * + * * @param returnType * the return type of the method. * @param argumentTypes @@ -643,7 +643,7 @@ public String getDescriptor() { */ public static String getMethodDescriptor(final Type returnType, final Type... argumentTypes) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append('('); for (int i = 0; i < argumentTypes.length; ++i) { argumentTypes[i].getDescriptor(buf); @@ -656,11 +656,11 @@ public static String getMethodDescriptor(final Type returnType, /** * Appends the descriptor corresponding to this Java type to the given * string buffer. - * + * * @param buf * the string buffer to which the descriptor must be appended. */ - private void getDescriptor(final StringBuffer buf) { + private void getDescriptor(final StringBuilder buf) { if (this.buf == null) { // descriptor is in byte 3 of 'off' for primitive types (buf == // null) @@ -683,7 +683,7 @@ private void getDescriptor(final StringBuffer buf) { * Returns the internal name of the given class. The internal name of a * class is its fully qualified name, as returned by Class.getName(), where * '.' are replaced by '/'. - * + * * @param c * an object or array class. * @return the internal name of the given class. @@ -694,27 +694,27 @@ public static String getInternalName(final Class c) { /** * Returns the descriptor corresponding to the given Java type. - * + * * @param c * an object class, a primitive class or an array class. * @return the descriptor corresponding to the given class. */ public static String getDescriptor(final Class c) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); getDescriptor(buf, c); return buf.toString(); } /** * Returns the descriptor corresponding to the given constructor. - * + * * @param c * a {@link Constructor Constructor} object. * @return the descriptor of the given constructor. */ public static String getConstructorDescriptor(final Constructor c) { Class[] parameters = c.getParameterTypes(); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); @@ -724,14 +724,14 @@ public static String getConstructorDescriptor(final Constructor c) { /** * Returns the descriptor corresponding to the given method. - * + * * @param m * a {@link Method Method} object. * @return the descriptor of the given method. */ public static String getMethodDescriptor(final Method m) { Class[] parameters = m.getParameterTypes(); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); @@ -743,13 +743,13 @@ public static String getMethodDescriptor(final Method m) { /** * Appends the descriptor of the given class to the given string buffer. - * + * * @param buf * the string buffer to which the descriptor must be appended. * @param c * the class whose descriptor must be computed. */ - private static void getDescriptor(final StringBuffer buf, final Class c) { + private static void getDescriptor(final StringBuilder buf, final Class c) { Class d = c; while (true) { if (d.isPrimitive()) { @@ -799,7 +799,7 @@ private static void getDescriptor(final StringBuffer buf, final Class c) { /** * Returns the size of values of this type. This method must not be used for * method types. - * + * * @return the size of values of this type, i.e., 2 for long and * double, 0 for void and 1 otherwise. */ @@ -811,7 +811,7 @@ public int getSize() { /** * Returns a JVM instruction opcode adapted to this Java type. This method * must not be used for method types. - * + * * @param opcode * a JVM instruction opcode. This opcode must be one of ILOAD, * ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, @@ -838,7 +838,7 @@ public int getOpcode(final int opcode) { /** * Tests if the given object is equal to this type. - * + * * @param o * the object to be compared to this type. * @return true if the given object is equal to this type. @@ -870,7 +870,7 @@ public boolean equals(final Object o) { /** * Returns a hash code value for this type. - * + * * @return a hash code value for this type. */ @Override @@ -886,7 +886,7 @@ public int hashCode() { /** * Returns a string representation of this type. - * + * * @return the descriptor of this type. */ @Override diff --git a/src/main/java/scala/tools/asm/TypePath.java b/src/main/java/scala/tools/asm/TypePath.java index c5478ef..b2b3232 100644 --- a/src/main/java/scala/tools/asm/TypePath.java +++ b/src/main/java/scala/tools/asm/TypePath.java @@ -28,12 +28,12 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * The path to a type argument, wildcard bound, array element type, or static * inner type within an enclosing type. - * + * * @author Eric Bruneton */ public class TypePath { @@ -74,7 +74,7 @@ public class TypePath { /** * Creates a new type path. - * + * * @param b * the byte array containing the type path in Java class file * format. @@ -88,7 +88,7 @@ public class TypePath { /** * Returns the length of this path. - * + * * @return the length of this path. */ public int getLength() { @@ -97,7 +97,7 @@ public int getLength() { /** * Returns the value of the given step of this path. - * + * * @param index * an index between 0 and {@link #getLength()}, exclusive. * @return {@link #ARRAY_ELEMENT ARRAY_ELEMENT}, {@link #INNER_TYPE @@ -112,7 +112,7 @@ public int getStep(int index) { * Returns the index of the type argument that the given step is stepping * into. This method should only be used for steps whose value is * {@link #TYPE_ARGUMENT TYPE_ARGUMENT}. - * + * * @param index * an index between 0 and {@link #getLength()}, exclusive. * @return the index of the type argument that the given step is stepping @@ -125,7 +125,7 @@ public int getStepArgument(int index) { /** * Converts a type path in string form, in the format used by * {@link #toString()}, into a TypePath object. - * + * * @param typePath * a type path in string form, in the format used by * {@link #toString()}. May be null or empty. diff --git a/src/main/java/scala/tools/asm/TypeReference.java b/src/main/java/scala/tools/asm/TypeReference.java index 118b0f6..2654b5d 100644 --- a/src/main/java/scala/tools/asm/TypeReference.java +++ b/src/main/java/scala/tools/asm/TypeReference.java @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm; +package org.objectweb.asm; /** * A reference to a type appearing in a class, field or method declaration, or @@ -36,7 +36,7 @@ * the referenced type is appearing (e.g. an 'extends', 'implements' or 'throws' * clause, a 'new' instruction, a 'catch' clause, a type cast, a local variable * declaration, etc). - * + * * @author Eric Bruneton */ public class TypeReference { @@ -180,7 +180,7 @@ public class TypeReference { /** * Creates a new TypeReference. - * + * * @param typeRef * the int encoded value of the type reference, as received in a * visit method related to type annotations, like @@ -192,7 +192,7 @@ public TypeReference(int typeRef) { /** * Returns a type reference of the given sort. - * + * * @param sort * {@link #FIELD FIELD}, {@link #METHOD_RETURN METHOD_RETURN}, * {@link #METHOD_RECEIVER METHOD_RECEIVER}, @@ -209,7 +209,7 @@ public static TypeReference newTypeReference(int sort) { /** * Returns a reference to a type parameter of a generic class or method. - * + * * @param sort * {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER} or * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}. @@ -225,7 +225,7 @@ public static TypeReference newTypeParameterReference(int sort, /** * Returns a reference to a type parameter bound of a generic class or * method. - * + * * @param sort * {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER} or * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}. @@ -245,7 +245,7 @@ public static TypeReference newTypeParameterBoundReference(int sort, /** * Returns a reference to the super class or to an interface of the * 'implements' clause of a class. - * + * * @param itfIndex * the index of an interface in the 'implements' clause of a * class, or -1 to reference the super class of the class. @@ -258,10 +258,10 @@ public static TypeReference newSuperTypeReference(int itfIndex) { /** * Returns a reference to the type of a formal parameter of a method. - * + * * @param paramIndex * the formal parameter index. - * + * * @return a reference to the type of the given method formal parameter. */ public static TypeReference newFormalParameterReference(int paramIndex) { @@ -272,10 +272,10 @@ public static TypeReference newFormalParameterReference(int paramIndex) { /** * Returns a reference to the type of an exception, in a 'throws' clause of * a method. - * + * * @param exceptionIndex * the index of an exception in a 'throws' clause of a method. - * + * * @return a reference to the type of the given exception. */ public static TypeReference newExceptionReference(int exceptionIndex) { @@ -285,11 +285,11 @@ public static TypeReference newExceptionReference(int exceptionIndex) { /** * Returns a reference to the type of the exception declared in a 'catch' * clause of a method. - * + * * @param tryCatchBlockIndex * the index of a try catch block (using the order in which they * are visited with visitTryCatchBlock). - * + * * @return a reference to the type of the given exception. */ public static TypeReference newTryCatchReference(int tryCatchBlockIndex) { @@ -300,7 +300,7 @@ public static TypeReference newTryCatchReference(int tryCatchBlockIndex) { /** * Returns a reference to the type of a type argument in a constructor or * method call or reference. - * + * * @param sort * {@link #CAST CAST}, * {@link #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT @@ -313,7 +313,7 @@ public static TypeReference newTryCatchReference(int tryCatchBlockIndex) { * METHOD_REFERENCE_TYPE_ARGUMENT}. * @param argIndex * the type argument index. - * + * * @return a reference to the type of the given type argument. */ public static TypeReference newTypeArgumentReference(int sort, int argIndex) { @@ -322,7 +322,7 @@ public static TypeReference newTypeArgumentReference(int sort, int argIndex) { /** * Returns the sort of this type reference. - * + * * @return {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER}, * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}, * {@link #CLASS_EXTENDS CLASS_EXTENDS}, @@ -357,7 +357,7 @@ public int getSort() { * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}, * {@link #CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} or * {@link #METHOD_TYPE_PARAMETER_BOUND METHOD_TYPE_PARAMETER_BOUND}. - * + * * @return a type parameter index. */ public int getTypeParameterIndex() { @@ -370,7 +370,7 @@ public int getTypeParameterIndex() { * method must only be used for type references whose sort is * {@link #CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} or * {@link #METHOD_TYPE_PARAMETER_BOUND METHOD_TYPE_PARAMETER_BOUND}. - * + * * @return a type parameter bound index. */ public int getTypeParameterBoundIndex() { @@ -381,7 +381,7 @@ public int getTypeParameterBoundIndex() { * Returns the index of the "super type" of a class that is referenced by * this type reference. This method must only be used for type references * whose sort is {@link #CLASS_EXTENDS CLASS_EXTENDS}. - * + * * @return the index of an interface in the 'implements' clause of a class, * or -1 if this type reference references the type of the super * class. @@ -394,7 +394,7 @@ public int getSuperTypeIndex() { * Returns the index of the formal parameter whose type is referenced by * this type reference. This method must only be used for type references * whose sort is {@link #METHOD_FORMAL_PARAMETER METHOD_FORMAL_PARAMETER}. - * + * * @return a formal parameter index. */ public int getFormalParameterIndex() { @@ -405,7 +405,7 @@ public int getFormalParameterIndex() { * Returns the index of the exception, in a 'throws' clause of a method, * whose type is referenced by this type reference. This method must only be * used for type references whose sort is {@link #THROWS THROWS}. - * + * * @return the index of an exception in the 'throws' clause of a method. */ public int getExceptionIndex() { @@ -417,7 +417,7 @@ public int getExceptionIndex() { * are visited with visitTryCatchBlock), whose 'catch' type is referenced by * this type reference. This method must only be used for type references * whose sort is {@link #EXCEPTION_PARAMETER EXCEPTION_PARAMETER} . - * + * * @return the index of an exception in the 'throws' clause of a method. */ public int getTryCatchBlockIndex() { @@ -433,7 +433,7 @@ public int getTryCatchBlockIndex() { * {@link #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or * {@link #METHOD_REFERENCE_TYPE_ARGUMENT METHOD_REFERENCE_TYPE_ARGUMENT}. - * + * * @return a type parameter index. */ public int getTypeArgumentIndex() { @@ -443,7 +443,7 @@ public int getTypeArgumentIndex() { /** * Returns the int encoded value of this type reference, suitable for use in * visit methods related to type annotations, like visitTypeAnnotation. - * + * * @return the int encoded value of this type reference. */ public int getValue() { diff --git a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java index 80c07bd..f4c7aec 100644 --- a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java +++ b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java @@ -27,16 +27,16 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.commons; +package org.objectweb.asm.commons; -import scala.tools.asm.Handle; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A {@link MethodVisitor} that can be used to approximate method size. - * + * * @author Eugene Kuleshov */ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes { diff --git a/src/main/java/scala/tools/asm/signature/SignatureReader.java b/src/main/java/scala/tools/asm/signature/SignatureReader.java index 9c7c388..1083b3d 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureReader.java +++ b/src/main/java/scala/tools/asm/signature/SignatureReader.java @@ -27,12 +27,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.signature; +package org.objectweb.asm.signature; /** * A type signature parser to make a signature visitor visit an existing * signature. - * + * * @author Thomas Hallgren * @author Eric Bruneton */ @@ -45,7 +45,7 @@ public class SignatureReader { /** * Constructs a {@link SignatureReader} for the given signature. - * + * * @param signature * A ClassSignature, MethodTypeSignature, or * FieldTypeSignature. @@ -60,12 +60,12 @@ public SignatureReader(final String signature) { * constructor (see {@link #SignatureReader(String) SignatureReader}). This * method is intended to be called on a {@link SignatureReader} that was * created using a ClassSignature (such as the signature - * parameter of the {@link scala.tools.asm.ClassVisitor#visit + * parameter of the {@link org.objectweb.asm.ClassVisitor#visit * ClassVisitor.visit} method) or a MethodTypeSignature (such as the * signature parameter of the - * {@link scala.tools.asm.ClassVisitor#visitMethod + * {@link org.objectweb.asm.ClassVisitor#visitMethod * ClassVisitor.visitMethod} method). - * + * * @param v * the visitor that must visit this signature. */ @@ -119,10 +119,10 @@ public void accept(final SignatureVisitor v) { * method is intended to be called on a {@link SignatureReader} that was * created using a FieldTypeSignature, such as the * signature parameter of the - * {@link scala.tools.asm.ClassVisitor#visitField ClassVisitor.visitField} - * or {@link scala.tools.asm.MethodVisitor#visitLocalVariable + * {@link org.objectweb.asm.ClassVisitor#visitField ClassVisitor.visitField} + * or {@link org.objectweb.asm.MethodVisitor#visitLocalVariable * MethodVisitor.visitLocalVariable} methods. - * + * * @param v * the visitor that must visit this signature. */ @@ -132,7 +132,7 @@ public void acceptType(final SignatureVisitor v) { /** * Parses a field type signature and makes the given visitor visit it. - * + * * @param signature * a string containing the signature that must be parsed. * @param pos diff --git a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java index 557ff85..1dba32d 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java +++ b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java @@ -27,9 +27,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.signature; +package org.objectweb.asm.signature; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.Opcodes; /** * A visitor to visit a generic signature. The methods of this interface must be @@ -50,7 +50,7 @@ * visitInnerClassType visitTypeArgument* )* visitEnd * ) ) * - * + * * @author Thomas Hallgren * @author Eric Bruneton */ @@ -79,7 +79,7 @@ public abstract class SignatureVisitor { /** * Constructs a new {@link SignatureVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -93,7 +93,7 @@ public SignatureVisitor(final int api) { /** * Visits a formal type parameter. - * + * * @param name * the name of the formal parameter. */ @@ -102,7 +102,7 @@ public void visitFormalTypeParameter(String name) { /** * Visits the class bound of the last visited formal type parameter. - * + * * @return a non null visitor to visit the signature of the class bound. */ public SignatureVisitor visitClassBound() { @@ -111,7 +111,7 @@ public SignatureVisitor visitClassBound() { /** * Visits an interface bound of the last visited formal type parameter. - * + * * @return a non null visitor to visit the signature of the interface bound. */ public SignatureVisitor visitInterfaceBound() { @@ -120,7 +120,7 @@ public SignatureVisitor visitInterfaceBound() { /** * Visits the type of the super class. - * + * * @return a non null visitor to visit the signature of the super class * type. */ @@ -130,7 +130,7 @@ public SignatureVisitor visitSuperclass() { /** * Visits the type of an interface implemented by the class. - * + * * @return a non null visitor to visit the signature of the interface type. */ public SignatureVisitor visitInterface() { @@ -139,7 +139,7 @@ public SignatureVisitor visitInterface() { /** * Visits the type of a method parameter. - * + * * @return a non null visitor to visit the signature of the parameter type. */ public SignatureVisitor visitParameterType() { @@ -148,7 +148,7 @@ public SignatureVisitor visitParameterType() { /** * Visits the return type of the method. - * + * * @return a non null visitor to visit the signature of the return type. */ public SignatureVisitor visitReturnType() { @@ -157,7 +157,7 @@ public SignatureVisitor visitReturnType() { /** * Visits the type of a method exception. - * + * * @return a non null visitor to visit the signature of the exception type. */ public SignatureVisitor visitExceptionType() { @@ -166,7 +166,7 @@ public SignatureVisitor visitExceptionType() { /** * Visits a signature corresponding to a primitive type. - * + * * @param descriptor * the descriptor of the primitive type, or 'V' for void * . @@ -176,7 +176,7 @@ public void visitBaseType(char descriptor) { /** * Visits a signature corresponding to a type variable. - * + * * @param name * the name of the type variable. */ @@ -185,7 +185,7 @@ public void visitTypeVariable(String name) { /** * Visits a signature corresponding to an array type. - * + * * @return a non null visitor to visit the signature of the array element * type. */ @@ -196,7 +196,7 @@ public SignatureVisitor visitArrayType() { /** * Starts the visit of a signature corresponding to a class or interface * type. - * + * * @param name * the internal name of the class or interface. */ @@ -205,7 +205,7 @@ public void visitClassType(String name) { /** * Visits an inner class. - * + * * @param name * the local name of the inner class in its enclosing class. */ @@ -221,7 +221,7 @@ public void visitTypeArgument() { /** * Visits a type argument of the last visited class or inner class type. - * + * * @param wildcard * '+', '-' or '='. * @return a non null visitor to visit the signature of the type argument. diff --git a/src/main/java/scala/tools/asm/signature/SignatureWriter.java b/src/main/java/scala/tools/asm/signature/SignatureWriter.java index 65756ee..cbd0d30 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureWriter.java +++ b/src/main/java/scala/tools/asm/signature/SignatureWriter.java @@ -27,22 +27,22 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.signature; +package org.objectweb.asm.signature; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.Opcodes; /** * A signature visitor that generates signatures in string format. - * + * * @author Thomas Hallgren * @author Eric Bruneton */ public class SignatureWriter extends SignatureVisitor { /** - * Buffer used to construct the signature. + * Builder used to construct the signature. */ - private final StringBuffer buf = new StringBuffer(); + private final StringBuilder buf = new StringBuilder(); /** * Indicates if the signature contains formal type parameters. @@ -193,7 +193,7 @@ public void visitEnd() { /** * Returns the signature that was built by this signature writer. - * + * * @return the signature that was built by this signature writer. */ @Override @@ -224,4 +224,4 @@ private void endArguments() { } argumentStack /= 2; } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java index 2ce0c8b..583be7f 100644 --- a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java @@ -27,18 +27,18 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.List; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a bytecode instruction. An instruction can appear * at most once in at most one {@link InsnList} at a time. - * + * * @author Eric Bruneton */ public abstract class AbstractInsnNode { @@ -133,8 +133,8 @@ public abstract class AbstractInsnNode { * only used for real instructions (i.e. not for labels, frames, or line * number nodes). This list is a list of {@link TypeAnnotationNode} objects. * May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -144,8 +144,8 @@ public abstract class AbstractInsnNode { * only used for real instructions (i.e. not for labels, frames, or line * number nodes). This list is a list of {@link TypeAnnotationNode} objects. * May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; @@ -170,7 +170,7 @@ public abstract class AbstractInsnNode { /** * Constructs a new {@link AbstractInsnNode}. - * + * * @param opcode * the opcode of the instruction to be constructed. */ @@ -181,7 +181,7 @@ protected AbstractInsnNode(final int opcode) { /** * Returns the opcode of this instruction. - * + * * @return the opcode of this instruction. */ public int getOpcode() { @@ -190,7 +190,7 @@ public int getOpcode() { /** * Returns the type of this instruction. - * + * * @return the type of this instruction, i.e. one the constants defined in * this class. */ @@ -199,7 +199,7 @@ public int getOpcode() { /** * Returns the previous instruction in the list to which this instruction * belongs, if any. - * + * * @return the previous instruction in the list to which this instruction * belongs, if any. May be null. */ @@ -210,7 +210,7 @@ public AbstractInsnNode getPrevious() { /** * Returns the next instruction in the list to which this instruction * belongs, if any. - * + * * @return the next instruction in the list to which this instruction * belongs, if any. May be null. */ @@ -220,7 +220,7 @@ public AbstractInsnNode getNext() { /** * Makes the given code visitor visit this instruction. - * + * * @param cv * a code visitor. */ @@ -228,7 +228,7 @@ public AbstractInsnNode getNext() { /** * Makes the given visitor visit the annotations of this instruction. - * + * * @param mv * a method visitor. */ @@ -251,7 +251,7 @@ protected final void acceptAnnotations(final MethodVisitor mv) { /** * Returns a copy of this instruction. - * + * * @param labels * a map from LabelNodes to cloned LabelNodes. * @return a copy of this instruction. The returned instruction does not @@ -262,7 +262,7 @@ public abstract AbstractInsnNode clone( /** * Returns the clone of the given label. - * + * * @param label * a label. * @param map @@ -276,7 +276,7 @@ static LabelNode clone(final LabelNode label, /** * Returns the clones of the given labels. - * + * * @param labels * a list of labels. * @param map @@ -294,7 +294,7 @@ static LabelNode[] clone(final List labels, /** * Clones the annotations of the given instruction into this instruction. - * + * * @param insn * the source instruction. * @return this instruction. diff --git a/src/main/java/scala/tools/asm/tree/AnnotationNode.java b/src/main/java/scala/tools/asm/tree/AnnotationNode.java index 8cbee05..18bb60d 100644 --- a/src/main/java/scala/tools/asm/tree/AnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/AnnotationNode.java @@ -27,17 +27,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.List; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents an annotationn. - * + * * @author Eric Bruneton */ public class AnnotationNode extends AnnotationVisitor { @@ -52,7 +52,7 @@ public class AnnotationNode extends AnnotationVisitor { * as two consecutive elements in the list. The name is a {@link String}, * and the value may be a {@link Byte}, {@link Boolean}, {@link Character}, * {@link Short}, {@link Integer}, {@link Long}, {@link Float}, - * {@link Double}, {@link String} or {@link scala.tools.asm.Type}, or an + * {@link Double}, {@link String} or {@link org.objectweb.asm.Type}, or an * two elements String array (for enumeration values), a * {@link AnnotationNode}, or a {@link List} of values of one of the * preceding types. The list may be null if there is no name value @@ -64,7 +64,7 @@ public class AnnotationNode extends AnnotationVisitor { * Constructs a new {@link AnnotationNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #AnnotationNode(int, String)} version. - * + * * @param desc * the class descriptor of the annotation class. * @throws IllegalStateException @@ -79,7 +79,7 @@ public AnnotationNode(final String desc) { /** * Constructs a new {@link AnnotationNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -93,7 +93,7 @@ public AnnotationNode(final int api, final String desc) { /** * Constructs a new {@link AnnotationNode} to visit an array value. - * + * * @param values * where the visited values must be stored. */ @@ -169,7 +169,7 @@ public void visitEnd() { * version. This methods checks that this node, and all its nodes * recursively, do not contain elements that were introduced in more recent * versions of the ASM API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -180,7 +180,7 @@ public void check(final int api) { /** * Makes the given visitor visit this annotation. - * + * * @param av * an annotation visitor. Maybe null. */ @@ -199,7 +199,7 @@ public void accept(final AnnotationVisitor av) { /** * Makes the given visitor visit a given annotation value. - * + * * @param av * an annotation visitor. Maybe null. * @param name diff --git a/src/main/java/scala/tools/asm/tree/ClassNode.java b/src/main/java/scala/tools/asm/tree/ClassNode.java index 304b4ec..4920796 100644 --- a/src/main/java/scala/tools/asm/tree/ClassNode.java +++ b/src/main/java/scala/tools/asm/tree/ClassNode.java @@ -27,23 +27,23 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.ClassVisitor; -import scala.tools.asm.FieldVisitor; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; /** * A node that represents a class. - * + * * @author Eric Bruneton */ public class ClassNode extends ClassVisitor { @@ -54,14 +54,14 @@ public class ClassNode extends ClassVisitor { public int version; /** - * The class's access flags (see {@link scala.tools.asm.Opcodes}). This + * The class's access flags (see {@link org.objectweb.asm.Opcodes}). This * field also indicates if the class is deprecated. */ public int access; /** * The internal name of the class (see - * {@link scala.tools.asm.Type#getInternalName() getInternalName}). + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). */ public String name; @@ -72,7 +72,7 @@ public class ClassNode extends ClassVisitor { /** * The internal of name of the super class (see - * {@link scala.tools.asm.Type#getInternalName() getInternalName}). For + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). For * interfaces, the super class is {@link Object}. May be null, but * only for the {@link Object} class. */ @@ -80,7 +80,7 @@ public class ClassNode extends ClassVisitor { /** * The internal names of the class's interfaces (see - * {@link scala.tools.asm.Type#getInternalName() getInternalName}). This + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). This * list is a list of {@link String} objects. */ public List interfaces; @@ -118,8 +118,8 @@ public class ClassNode extends ClassVisitor { /** * The runtime visible annotations of this class. This list is a list of * {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label visible */ public List visibleAnnotations; @@ -127,8 +127,8 @@ public class ClassNode extends ClassVisitor { /** * The runtime invisible annotations of this class. This list is a list of * {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label invisible */ public List invisibleAnnotations; @@ -136,8 +136,8 @@ public class ClassNode extends ClassVisitor { /** * The runtime visible type annotations of this class. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -145,8 +145,8 @@ public class ClassNode extends ClassVisitor { /** * The runtime invisible type annotations of this class. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; @@ -154,32 +154,32 @@ public class ClassNode extends ClassVisitor { /** * The non standard attributes of this class. This list is a list of * {@link Attribute} objects. May be null. - * - * @associates scala.tools.asm.Attribute + * + * @associates org.objectweb.asm.Attribute */ public List attrs; /** * Informations about the inner classes of this class. This list is a list * of {@link InnerClassNode} objects. - * - * @associates scala.tools.asm.tree.InnerClassNode + * + * @associates org.objectweb.asm.tree.InnerClassNode */ public List innerClasses; /** * The fields of this class. This list is a list of {@link FieldNode} * objects. - * - * @associates scala.tools.asm.tree.FieldNode + * + * @associates org.objectweb.asm.tree.FieldNode */ public List fields; /** * The methods of this class. This list is a list of {@link MethodNode} * objects. - * - * @associates scala.tools.asm.tree.MethodNode + * + * @associates org.objectweb.asm.tree.MethodNode */ public List methods; @@ -187,7 +187,7 @@ public class ClassNode extends ClassVisitor { * Constructs a new {@link ClassNode}. Subclasses must not use this * constructor. Instead, they must use the {@link #ClassNode(int)} * version. - * + * * @throws IllegalStateException * If a subclass calls this constructor. */ @@ -200,7 +200,7 @@ public ClassNode() { /** * Constructs a new {@link ClassNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -327,7 +327,7 @@ public void visitEnd() { * This methods checks that this node, and all its nodes recursively, do not * contain elements that were introduced in more recent versions of the ASM * API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -353,7 +353,7 @@ public void check(final int api) { /** * Makes the given class visitor visit this class. - * + * * @param cv * a class visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java index c027de1..9b0c95f 100644 --- a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java @@ -27,23 +27,23 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a field instruction. A field instruction is an * instruction that loads or stores the value of a field of an object. - * + * * @author Eric Bruneton */ public class FieldInsnNode extends AbstractInsnNode { /** * The internal name of the field's owner class (see - * {@link scala.tools.asm.Type#getInternalName() getInternalName}). + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). */ public String owner; @@ -53,24 +53,24 @@ public class FieldInsnNode extends AbstractInsnNode { public String name; /** - * The field's descriptor (see {@link scala.tools.asm.Type}). + * The field's descriptor (see {@link org.objectweb.asm.Type}). */ public String desc; /** * Constructs a new {@link FieldInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. * @param owner * the internal name of the field's owner class (see - * {@link scala.tools.asm.Type#getInternalName() + * {@link org.objectweb.asm.Type#getInternalName() * getInternalName}). * @param name * the field's name. * @param desc - * the field's descriptor (see {@link scala.tools.asm.Type}). + * the field's descriptor (see {@link org.objectweb.asm.Type}). */ public FieldInsnNode(final int opcode, final String owner, final String name, final String desc) { @@ -82,7 +82,7 @@ public FieldInsnNode(final int opcode, final String owner, /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be GETSTATIC, * PUTSTATIC, GETFIELD or PUTFIELD. diff --git a/src/main/java/scala/tools/asm/tree/FieldNode.java b/src/main/java/scala/tools/asm/tree/FieldNode.java index 3fb14da..6a8d226 100644 --- a/src/main/java/scala/tools/asm/tree/FieldNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldNode.java @@ -27,27 +27,27 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.List; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.ClassVisitor; -import scala.tools.asm.FieldVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; /** * A node that represents a field. - * + * * @author Eric Bruneton */ public class FieldNode extends FieldVisitor { /** - * The field's access flags (see {@link scala.tools.asm.Opcodes}). This + * The field's access flags (see {@link org.objectweb.asm.Opcodes}). This * field also indicates if the field is synthetic and/or deprecated. */ public int access; @@ -58,7 +58,7 @@ public class FieldNode extends FieldVisitor { public String name; /** - * The field's descriptor (see {@link scala.tools.asm.Type}). + * The field's descriptor (see {@link org.objectweb.asm.Type}). */ public String desc; @@ -77,8 +77,8 @@ public class FieldNode extends FieldVisitor { /** * The runtime visible annotations of this field. This list is a list of * {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label visible */ public List visibleAnnotations; @@ -86,8 +86,8 @@ public class FieldNode extends FieldVisitor { /** * The runtime invisible annotations of this field. This list is a list of * {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label invisible */ public List invisibleAnnotations; @@ -95,8 +95,8 @@ public class FieldNode extends FieldVisitor { /** * The runtime visible type annotations of this field. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -104,8 +104,8 @@ public class FieldNode extends FieldVisitor { /** * The runtime invisible type annotations of this field. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; @@ -113,8 +113,8 @@ public class FieldNode extends FieldVisitor { /** * The non standard attributes of this field. This list is a list of * {@link Attribute} objects. May be null. - * - * @associates scala.tools.asm.Attribute + * + * @associates org.objectweb.asm.Attribute */ public List attrs; @@ -122,15 +122,15 @@ public class FieldNode extends FieldVisitor { * Constructs a new {@link FieldNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #FieldNode(int, int, String, String, String, Object)} version. - * + * * @param access * the field's access flags (see - * {@link scala.tools.asm.Opcodes}). This parameter also + * {@link org.objectweb.asm.Opcodes}). This parameter also * indicates if the field is synthetic and/or deprecated. * @param name * the field's name. * @param desc - * the field's descriptor (see {@link scala.tools.asm.Type + * the field's descriptor (see {@link org.objectweb.asm.Type * Type}). * @param signature * the field's signature. @@ -153,18 +153,18 @@ public FieldNode(final int access, final String name, final String desc, /** * Constructs a new {@link FieldNode}. Subclasses must not use this * constructor. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. * @param access * the field's access flags (see - * {@link scala.tools.asm.Opcodes}). This parameter also + * {@link org.objectweb.asm.Opcodes}). This parameter also * indicates if the field is synthetic and/or deprecated. * @param name * the field's name. * @param desc - * the field's descriptor (see {@link scala.tools.asm.Type + * the field's descriptor (see {@link org.objectweb.asm.Type * Type}). * @param signature * the field's signature. @@ -245,7 +245,7 @@ public void visitEnd() { * This methods checks that this node, and all its nodes recursively, do not * contain elements that were introduced in more recent versions of the ASM * API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -265,7 +265,7 @@ public void check(final int api) { /** * Makes the given class visitor visit this field. - * + * * @param cv * a class visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/FrameNode.java b/src/main/java/scala/tools/asm/tree/FrameNode.java index f13fc66..bd1ea70 100644 --- a/src/main/java/scala/tools/asm/tree/FrameNode.java +++ b/src/main/java/scala/tools/asm/tree/FrameNode.java @@ -27,15 +27,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents a stack map frame. These nodes are pseudo instruction @@ -48,7 +48,7 @@ *
* (*) this is mandatory only for classes whose version is greater than or equal * to {@link Opcodes#V1_6 V1_6}. - * + * * @author Eric Bruneton */ public class FrameNode extends AbstractInsnNode { @@ -83,7 +83,7 @@ private FrameNode() { /** * Constructs a new {@link FrameNode}. - * + * * @param type * the type of this frame. Must be {@link Opcodes#F_NEW} for * expanded frames, or {@link Opcodes#F_FULL}, @@ -136,7 +136,7 @@ public int getType() { /** * Makes the given visitor visit this stack map frame. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/IincInsnNode.java b/src/main/java/scala/tools/asm/tree/IincInsnNode.java index c37ac91..5305b35 100644 --- a/src/main/java/scala/tools/asm/tree/IincInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IincInsnNode.java @@ -27,16 +27,16 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents an IINC instruction. - * + * * @author Eric Bruneton */ public class IincInsnNode extends AbstractInsnNode { @@ -53,7 +53,7 @@ public class IincInsnNode extends AbstractInsnNode { /** * Constructs a new {@link IincInsnNode}. - * + * * @param var * index of the local variable to be incremented. * @param incr @@ -80,4 +80,4 @@ public void accept(final MethodVisitor mv) { public AbstractInsnNode clone(final Map labels) { return new IincInsnNode(var, incr).cloneAnnotations(this); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/InnerClassNode.java b/src/main/java/scala/tools/asm/tree/InnerClassNode.java index aa3810c..5198cfb 100644 --- a/src/main/java/scala/tools/asm/tree/InnerClassNode.java +++ b/src/main/java/scala/tools/asm/tree/InnerClassNode.java @@ -27,26 +27,26 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; -import scala.tools.asm.ClassVisitor; +import org.objectweb.asm.ClassVisitor; /** * A node that represents an inner class. - * + * * @author Eric Bruneton */ public class InnerClassNode { /** * The internal name of an inner class (see - * {@link scala.tools.asm.Type#getInternalName() getInternalName}). + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). */ public String name; /** * The internal name of the class to which the inner class belongs (see - * {@link scala.tools.asm.Type#getInternalName() getInternalName}). May be + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). May be * null. */ public String outerName; @@ -65,14 +65,14 @@ public class InnerClassNode { /** * Constructs a new {@link InnerClassNode}. - * + * * @param name * the internal name of an inner class (see - * {@link scala.tools.asm.Type#getInternalName() + * {@link org.objectweb.asm.Type#getInternalName() * getInternalName}). * @param outerName * the internal name of the class to which the inner class - * belongs (see {@link scala.tools.asm.Type#getInternalName() + * belongs (see {@link org.objectweb.asm.Type#getInternalName() * getInternalName}). May be null. * @param innerName * the (simple) name of the inner class inside its enclosing @@ -91,7 +91,7 @@ public InnerClassNode(final String name, final String outerName, /** * Makes the given class visitor visit this inner class. - * + * * @param cv * a class visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/InsnList.java b/src/main/java/scala/tools/asm/tree/InsnList.java index acae4e9..fadaeb5 100644 --- a/src/main/java/scala/tools/asm/tree/InsnList.java +++ b/src/main/java/scala/tools/asm/tree/InsnList.java @@ -27,12 +27,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ListIterator; import java.util.NoSuchElementException; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A doubly linked list of {@link AbstractInsnNode} objects. This @@ -63,7 +63,7 @@ public class InsnList { /** * Returns the number of instructions in this list. - * + * * @return the number of instructions in this list. */ public int size() { @@ -72,7 +72,7 @@ public int size() { /** * Returns the first instruction in this list. - * + * * @return the first instruction in this list, or null if the list * is empty. */ @@ -82,7 +82,7 @@ public AbstractInsnNode getFirst() { /** * Returns the last instruction in this list. - * + * * @return the last instruction in this list, or null if the list * is empty. */ @@ -95,7 +95,7 @@ public AbstractInsnNode getLast() { * of the instructions in this list to avoid scanning the whole list each * time it is called. Once the cache is built, this method run in constant * time. This cache is invalidated by all the methods that modify the list. - * + * * @param index * the index of the instruction that must be returned. * @return the instruction whose index is given. @@ -116,7 +116,7 @@ public AbstractInsnNode get(final int index) { * Returns true if the given instruction belongs to this list. This * method always scans the instructions of this list until it finds the * given instruction or reaches the end of the list. - * + * * @param insn * an instruction. * @return true if the given instruction belongs to this list. @@ -135,7 +135,7 @@ public boolean contains(final AbstractInsnNode insn) { * list each time it is called. Once the cache is built, this method run in * constant time. The cache is invalidated by all the methods that modify * the list. - * + * * @param insn * an instruction of this list. * @return the index of the given instruction in this list. The result of @@ -152,7 +152,7 @@ public int indexOf(final AbstractInsnNode insn) { /** * Makes the given visitor visit all of the instructions in this list. - * + * * @param mv * the method visitor that must visit the instructions. */ @@ -166,7 +166,7 @@ public void accept(final MethodVisitor mv) { /** * Returns an iterator over the instructions in this list. - * + * * @return an iterator over the instructions in this list. */ public ListIterator iterator() { @@ -175,7 +175,10 @@ public ListIterator iterator() { /** * Returns an iterator over the instructions in this list. - * + * + * @param index + * index of instruction for the iterator to start at + * * @return an iterator over the instructions in this list. */ @SuppressWarnings("unchecked") @@ -185,7 +188,7 @@ public ListIterator iterator(int index) { /** * Returns an array containing all of the instructions in this list. - * + * * @return an array containing all of the instructions in this list. */ public AbstractInsnNode[] toArray() { @@ -202,7 +205,7 @@ public AbstractInsnNode[] toArray() { /** * Replaces an instruction of this list with another instruction. - * + * * @param location * an instruction of this list. * @param insn @@ -238,20 +241,12 @@ public void set(final AbstractInsnNode location, final AbstractInsnNode insn) { /** * Adds the given instruction to the end of this list. - * + * * @param insn * an instruction, which must not belong to any * {@link InsnList}. */ public void add(final AbstractInsnNode insn) { - if(insn.prev != null || insn.next != null) { - // Adding an instruction that still refers to others (in the same or another InsnList) leads to hard to debug bugs. - // Initially everything may look ok (e.g. iteration follows `next` thus a stale `prev` isn't noticed). - // However, a stale link brings the doubly-linked into disarray e.g. upon removing an element, - // which results in the `next` of a stale `prev` being updated, among other failure scenarios. - // Better fail early. - throw new RuntimeException("Instruction " + insn + " already belongs to some InsnList."); - } ++size; if (last == null) { first = insn; @@ -267,7 +262,7 @@ public void add(final AbstractInsnNode insn) { /** * Adds the given instructions to the end of this list. - * + * * @param insns * an instruction list, which is cleared during the process. This * list must be different from 'this'. @@ -292,7 +287,7 @@ public void add(final InsnList insns) { /** * Inserts the given instruction at the begining of this list. - * + * * @param insn * an instruction, which must not belong to any * {@link InsnList}. @@ -313,7 +308,7 @@ public void insert(final AbstractInsnNode insn) { /** * Inserts the given instructions at the begining of this list. - * + * * @param insns * an instruction list, which is cleared during the process. This * list must be different from 'this'. @@ -338,7 +333,7 @@ public void insert(final InsnList insns) { /** * Inserts the given instruction after the specified instruction. - * + * * @param location * an instruction of this list after which insn must be * inserted. @@ -364,7 +359,7 @@ public void insert(final AbstractInsnNode location, /** * Inserts the given instructions after the specified instruction. - * + * * @param location * an instruction of this list after which the * instructions must be inserted. @@ -394,7 +389,7 @@ public void insert(final AbstractInsnNode location, final InsnList insns) { /** * Inserts the given instruction before the specified instruction. - * + * * @param location * an instruction of this list before which insn must be * inserted. @@ -420,7 +415,7 @@ public void insertBefore(final AbstractInsnNode location, /** * Inserts the given instructions before the specified instruction. - * + * * @param location * an instruction of this list before which the * instructions must be inserted. @@ -451,7 +446,7 @@ public void insertBefore(final AbstractInsnNode location, /** * Removes the given instruction from this list. - * + * * @param insn * the instruction of this list that must be removed. */ @@ -484,7 +479,7 @@ public void remove(final AbstractInsnNode insn) { /** * Removes all of the instructions of this list. - * + * * @param mark * if the instructions must be marked as no longer belonging to * any {@link InsnList}. @@ -610,14 +605,28 @@ public int previousIndex() { } public void add(Object o) { - InsnList.this.insertBefore(next, (AbstractInsnNode) o); + if (next != null) { + InsnList.this.insertBefore(next, (AbstractInsnNode) o); + } else if (prev != null) { + InsnList.this.insert(prev, (AbstractInsnNode) o); + } else { + InsnList.this.add((AbstractInsnNode) o); + } prev = (AbstractInsnNode) o; remove = null; } public void set(Object o) { - InsnList.this.set(next.prev, (AbstractInsnNode) o); - prev = (AbstractInsnNode) o; + if (remove != null) { + InsnList.this.set(remove, (AbstractInsnNode) o); + if (remove == prev) { + prev = (AbstractInsnNode) o; + } else { + next = (AbstractInsnNode) o; + } + } else { + throw new IllegalStateException(); + } } } } diff --git a/src/main/java/scala/tools/asm/tree/InsnNode.java b/src/main/java/scala/tools/asm/tree/InsnNode.java index f531392..f6feba7 100644 --- a/src/main/java/scala/tools/asm/tree/InsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InsnNode.java @@ -27,22 +27,22 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a zero operand instruction. - * + * * @author Eric Bruneton */ public class InsnNode extends AbstractInsnNode { /** * Constructs a new {@link InsnNode}. - * + * * @param opcode * the opcode of the instruction to be constructed. This opcode * must be NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, @@ -71,7 +71,7 @@ public int getType() { /** * Makes the given visitor visit this instruction. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/IntInsnNode.java b/src/main/java/scala/tools/asm/tree/IntInsnNode.java index 6bbe8d8..6d8e7cd 100644 --- a/src/main/java/scala/tools/asm/tree/IntInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IntInsnNode.java @@ -27,15 +27,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents an instruction with a single int operand. - * + * * @author Eric Bruneton */ public class IntInsnNode extends AbstractInsnNode { @@ -47,7 +47,7 @@ public class IntInsnNode extends AbstractInsnNode { /** * Constructs a new {@link IntInsnNode}. - * + * * @param opcode * the opcode of the instruction to be constructed. This opcode * must be BIPUSH, SIPUSH or NEWARRAY. @@ -61,7 +61,7 @@ public IntInsnNode(final int opcode, final int operand) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be BIPUSH, SIPUSH * or NEWARRAY. diff --git a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java index 0f85e60..55e3a6a 100644 --- a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java @@ -27,17 +27,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.Handle; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.Handle; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents an invokedynamic instruction. - * + * * @author Remi Forax */ public class InvokeDynamicInsnNode extends AbstractInsnNode { @@ -64,11 +64,11 @@ public class InvokeDynamicInsnNode extends AbstractInsnNode { /** * Constructs a new {@link InvokeDynamicInsnNode}. - * + * * @param name * invokedynamic name. * @param desc - * invokedynamic descriptor (see {@link scala.tools.asm.Type}). + * invokedynamic descriptor (see {@link org.objectweb.asm.Type}). * @param bsm * the bootstrap method. * @param bsmArgs @@ -99,4 +99,4 @@ public AbstractInsnNode clone(final Map labels) { return new InvokeDynamicInsnNode(name, desc, bsm, bsmArgs) .cloneAnnotations(this); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java index 8b8a769..5c461f3 100644 --- a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java @@ -27,16 +27,16 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a jump instruction. A jump instruction is an * instruction that may jump to another instruction. - * + * * @author Eric Bruneton */ public class JumpInsnNode extends AbstractInsnNode { @@ -49,7 +49,7 @@ public class JumpInsnNode extends AbstractInsnNode { /** * Constructs a new {@link JumpInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, @@ -67,7 +67,7 @@ public JumpInsnNode(final int opcode, final LabelNode label) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be IFEQ, IFNE, * IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, diff --git a/src/main/java/scala/tools/asm/tree/LabelNode.java b/src/main/java/scala/tools/asm/tree/LabelNode.java index 44c48c1..b6381bd 100644 --- a/src/main/java/scala/tools/asm/tree/LabelNode.java +++ b/src/main/java/scala/tools/asm/tree/LabelNode.java @@ -27,12 +27,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; /** * An {@link AbstractInsnNode} that encapsulates a {@link Label}. @@ -75,4 +75,4 @@ public AbstractInsnNode clone(final Map labels) { public void resetLabel() { label = null; } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java index 1cc850b..7441a42 100644 --- a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java @@ -27,16 +27,16 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents an LDC instruction. - * + * * @author Eric Bruneton */ public class LdcInsnNode extends AbstractInsnNode { @@ -44,13 +44,13 @@ public class LdcInsnNode extends AbstractInsnNode { /** * The constant to be loaded on the stack. This parameter must be a non null * {@link Integer}, a {@link Float}, a {@link Long}, a {@link Double}, a - * {@link String} or a {@link scala.tools.asm.Type}. + * {@link String} or a {@link org.objectweb.asm.Type}. */ public Object cst; /** * Constructs a new {@link LdcInsnNode}. - * + * * @param cst * the constant to be loaded on the stack. This parameter must be * a non null {@link Integer}, a {@link Float}, a {@link Long}, a @@ -76,4 +76,4 @@ public void accept(final MethodVisitor mv) { public AbstractInsnNode clone(final Map labels) { return new LdcInsnNode(cst).cloneAnnotations(this); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/LineNumberNode.java b/src/main/java/scala/tools/asm/tree/LineNumberNode.java index 9947aa7..cda1694 100644 --- a/src/main/java/scala/tools/asm/tree/LineNumberNode.java +++ b/src/main/java/scala/tools/asm/tree/LineNumberNode.java @@ -27,16 +27,16 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a line number declaration. These nodes are pseudo * instruction nodes in order to be inserted in an instruction list. - * + * * @author Eric Bruneton */ public class LineNumberNode extends AbstractInsnNode { @@ -54,7 +54,7 @@ public class LineNumberNode extends AbstractInsnNode { /** * Constructs a new {@link LineNumberNode}. - * + * * @param line * a line number. This number refers to the source file from * which the class was compiled. diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java index d05b808..4ca7da4 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java @@ -28,21 +28,21 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; -import scala.tools.asm.TypeReference; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; +import org.objectweb.asm.TypeReference; /** * A node that represents a type annotation on a local or resource variable. - * + * * @author Eric Bruneton */ public class LocalVariableAnnotationNode extends TypeAnnotationNode { @@ -71,7 +71,7 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode { * not use this constructor. Instead, they must use the * {@link #LocalVariableAnnotationNode(int, TypePath, LabelNode[], LabelNode[], int[], String)} * version. - * + * * @param typeRef * a reference to the annotated type. See {@link TypeReference}. * @param typePath @@ -98,7 +98,7 @@ public LocalVariableAnnotationNode(int typeRef, TypePath typePath, /** * Constructs a new {@link LocalVariableAnnotationNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -136,7 +136,7 @@ public LocalVariableAnnotationNode(int api, int typeRef, TypePath typePath, /** * Makes the given visitor visit this type annotation. - * + * * @param mv * the visitor that must visit this annotation. * @param visible diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java index 0d8e273..033f83e 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java @@ -27,13 +27,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a local variable declaration. - * + * * @author Eric Bruneton */ public class LocalVariableNode { @@ -72,7 +72,7 @@ public class LocalVariableNode { /** * Constructs a new {@link LocalVariableNode}. - * + * * @param name * the name of a local variable. * @param desc @@ -101,7 +101,7 @@ public LocalVariableNode(final String name, final String desc, /** * Makes the given visitor visit this local variable declaration. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java index b4e4e8c..39f7ef1 100644 --- a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java @@ -27,20 +27,20 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents a LOOKUPSWITCH instruction. - * + * * @author Eric Bruneton */ public class LookupSwitchInsnNode extends AbstractInsnNode { @@ -63,7 +63,7 @@ public class LookupSwitchInsnNode extends AbstractInsnNode { /** * Constructs a new {@link LookupSwitchInsnNode}. - * + * * @param dflt * beginning of the default handler block. * @param keys diff --git a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java index 5c8c835..02215f4 100644 --- a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java @@ -27,25 +27,24 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents a method instruction. A method instruction is an * instruction that invokes a method. - * + * * @author Eric Bruneton */ public class MethodInsnNode extends AbstractInsnNode { /** * The internal name of the method's owner class (see - * {@link scala.tools.asm.Type#getInternalName() getInternalName}). - * For methods of arrays, e.g., clone(), the array type descriptor. + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). */ public String owner; @@ -55,7 +54,7 @@ public class MethodInsnNode extends AbstractInsnNode { public String name; /** - * The method's descriptor (see {@link scala.tools.asm.Type}). + * The method's descriptor (see {@link org.objectweb.asm.Type}). */ public String desc; @@ -66,19 +65,19 @@ public class MethodInsnNode extends AbstractInsnNode { /** * Constructs a new {@link MethodInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or * INVOKEINTERFACE. * @param owner * the internal name of the method's owner class (see - * {@link scala.tools.asm.Type#getInternalName() + * {@link org.objectweb.asm.Type#getInternalName() * getInternalName}). * @param name * the method's name. * @param desc - * the method's descriptor (see {@link scala.tools.asm.Type}). + * the method's descriptor (see {@link org.objectweb.asm.Type}). */ @Deprecated public MethodInsnNode(final int opcode, final String owner, @@ -88,19 +87,19 @@ public MethodInsnNode(final int opcode, final String owner, /** * Constructs a new {@link MethodInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or * INVOKEINTERFACE. * @param owner * the internal name of the method's owner class (see - * {@link scala.tools.asm.Type#getInternalName() + * {@link org.objectweb.asm.Type#getInternalName() * getInternalName}). * @param name * the method's name. * @param desc - * the method's descriptor (see {@link scala.tools.asm.Type}). + * the method's descriptor (see {@link org.objectweb.asm.Type}). * @param itf * if the method's owner class is an interface. */ @@ -115,7 +114,7 @@ public MethodInsnNode(final int opcode, final String owner, /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be INVOKEVIRTUAL, * INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE. @@ -139,4 +138,4 @@ public void accept(final MethodVisitor mv) { public AbstractInsnNode clone(final Map labels) { return new MethodInsnNode(opcode, owner, name, desc, itf); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/MethodNode.java b/src/main/java/scala/tools/asm/tree/MethodNode.java index 1630866..1edb4a7 100644 --- a/src/main/java/scala/tools/asm/tree/MethodNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodNode.java @@ -27,25 +27,25 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.ClassVisitor; -import scala.tools.asm.Handle; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.TypePath; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.TypePath; /** * A node that represents a method. - * + * * @author Eric Bruneton */ public class MethodNode extends MethodVisitor { @@ -86,8 +86,8 @@ public class MethodNode extends MethodVisitor { /** * The runtime visible annotations of this method. This list is a list of * {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label visible */ public List visibleAnnotations; @@ -95,8 +95,8 @@ public class MethodNode extends MethodVisitor { /** * The runtime invisible annotations of this method. This list is a list of * {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label invisible */ public List invisibleAnnotations; @@ -104,8 +104,8 @@ public class MethodNode extends MethodVisitor { /** * The runtime visible type annotations of this method. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -113,8 +113,8 @@ public class MethodNode extends MethodVisitor { /** * The runtime invisible type annotations of this method. This list is a * list of {@link TypeAnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; @@ -122,8 +122,8 @@ public class MethodNode extends MethodVisitor { /** * The non standard attributes of this method. This list is a list of * {@link Attribute} objects. May be null. - * - * @associates scala.tools.asm.Attribute + * + * @associates org.objectweb.asm.Attribute */ public List attrs; @@ -140,8 +140,8 @@ public class MethodNode extends MethodVisitor { /** * The runtime visible parameter annotations of this method. These lists are * lists of {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label invisible parameters */ public List[] visibleParameterAnnotations; @@ -149,8 +149,8 @@ public class MethodNode extends MethodVisitor { /** * The runtime invisible parameter annotations of this method. These lists * are lists of {@link AnnotationNode} objects. May be null. - * - * @associates scala.tools.asm.tree.AnnotationNode + * + * @associates org.objectweb.asm.tree.AnnotationNode * @label visible parameters */ public List[] invisibleParameterAnnotations; @@ -158,8 +158,8 @@ public class MethodNode extends MethodVisitor { /** * The instructions of this method. This list is a list of * {@link AbstractInsnNode} objects. - * - * @associates scala.tools.asm.tree.AbstractInsnNode + * + * @associates org.objectweb.asm.tree.AbstractInsnNode * @label instructions */ public InsnList instructions; @@ -167,8 +167,8 @@ public class MethodNode extends MethodVisitor { /** * The try catch blocks of this method. This list is a list of * {@link TryCatchBlockNode} objects. - * - * @associates scala.tools.asm.tree.TryCatchBlockNode + * + * @associates org.objectweb.asm.tree.TryCatchBlockNode */ public List tryCatchBlocks; @@ -185,24 +185,24 @@ public class MethodNode extends MethodVisitor { /** * The local variables of this method. This list is a list of * {@link LocalVariableNode} objects. May be null - * - * @associates scala.tools.asm.tree.LocalVariableNode + * + * @associates org.objectweb.asm.tree.LocalVariableNode */ public List localVariables; /** * The visible local variable annotations of this method. This list is a * list of {@link LocalVariableAnnotationNode} objects. May be null - * - * @associates scala.tools.asm.tree.LocalVariableAnnotationNode + * + * @associates org.objectweb.asm.tree.LocalVariableAnnotationNode */ public List visibleLocalVariableAnnotations; /** * The invisible local variable annotations of this method. This list is a * list of {@link LocalVariableAnnotationNode} objects. May be null - * - * @associates scala.tools.asm.tree.LocalVariableAnnotationNode + * + * @associates org.objectweb.asm.tree.LocalVariableAnnotationNode */ public List invisibleLocalVariableAnnotations; @@ -215,7 +215,7 @@ public class MethodNode extends MethodVisitor { * Constructs an uninitialized {@link MethodNode}. Subclasses must not * use this constructor. Instead, they must use the * {@link #MethodNode(int)} version. - * + * * @throws IllegalStateException * If a subclass calls this constructor. */ @@ -228,7 +228,7 @@ public MethodNode() { /** * Constructs an uninitialized {@link MethodNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -242,7 +242,7 @@ public MethodNode(final int api) { * Constructs a new {@link MethodNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #MethodNode(int, int, String, String, String, String[])} version. - * + * * @param access * the method's access flags (see {@link Opcodes}). This * parameter also indicates if the method is synthetic and/or @@ -270,7 +270,7 @@ public MethodNode(final int access, final String name, final String desc, /** * Constructs a new {@link MethodNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -616,14 +616,14 @@ public void visitEnd() { * LabelNode if necessary. The default implementation of this method uses * the {@link Label#info} field to store associations between labels and * label nodes. - * + * * @param l * a Label. * @return the LabelNode corresponding to l. */ protected LabelNode getLabelNode(final Label l) { if (!(l.info instanceof LabelNode)) { - l.info = new LabelNode(l); + l.info = new LabelNode(); } return (LabelNode) l.info; } @@ -657,7 +657,7 @@ private Object[] getLabelNodes(final Object[] objs) { * version. This methods checks that this node, and all its nodes * recursively, do not contain elements that were introduced in more recent * versions of the ASM API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -714,7 +714,7 @@ public void check(final int api) { /** * Makes the given class visitor visit this method. - * + * * @param cv * a class visitor. */ @@ -730,7 +730,7 @@ public void accept(final ClassVisitor cv) { /** * Makes the given method visitor visit this method. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java index a8339a2..8e42d2d 100644 --- a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java @@ -27,22 +27,22 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents a MULTIANEWARRAY instruction. - * + * * @author Eric Bruneton */ public class MultiANewArrayInsnNode extends AbstractInsnNode { /** - * An array type descriptor (see {@link scala.tools.asm.Type}). + * An array type descriptor (see {@link org.objectweb.asm.Type}). */ public String desc; @@ -53,9 +53,9 @@ public class MultiANewArrayInsnNode extends AbstractInsnNode { /** * Constructs a new {@link MultiANewArrayInsnNode}. - * + * * @param desc - * an array type descriptor (see {@link scala.tools.asm.Type}). + * an array type descriptor (see {@link org.objectweb.asm.Type}). * @param dims * number of dimensions of the array to allocate. */ @@ -81,4 +81,4 @@ public AbstractInsnNode clone(final Map labels) { return new MultiANewArrayInsnNode(desc, dims).cloneAnnotations(this); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/ParameterNode.java b/src/main/java/scala/tools/asm/tree/ParameterNode.java index a3e55d5..31360b8 100644 --- a/src/main/java/scala/tools/asm/tree/ParameterNode.java +++ b/src/main/java/scala/tools/asm/tree/ParameterNode.java @@ -27,13 +27,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a parameter access and name. - * + * * @author Remi Forax */ public class ParameterNode { @@ -43,7 +43,7 @@ public class ParameterNode { public String name; /** - * The parameter's access flags (see {@link scala.tools.asm.Opcodes}). + * The parameter's access flags (see {@link org.objectweb.asm.Opcodes}). * Valid values are ACC_FINAL, ACC_SYNTHETIC and * ACC_MANDATED. */ @@ -51,11 +51,11 @@ public class ParameterNode { /** * Constructs a new {@link ParameterNode}. - * + * * @param access * The parameter's access flags. Valid values are * ACC_FINAL, ACC_SYNTHETIC or/and - * ACC_MANDATED (see {@link scala.tools.asm.Opcodes}). + * ACC_MANDATED (see {@link org.objectweb.asm.Opcodes}). * @param name * the parameter's name. */ @@ -66,7 +66,7 @@ public ParameterNode(final String name, final int access) { /** * Makes the given visitor visit this parameter declaration. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java index fb17b9e..3e8937e 100644 --- a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java @@ -27,20 +27,20 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; /** * A node that represents a TABLESWITCH instruction. - * + * * @author Eric Bruneton */ public class TableSwitchInsnNode extends AbstractInsnNode { @@ -68,7 +68,7 @@ public class TableSwitchInsnNode extends AbstractInsnNode { /** * Constructs a new {@link TableSwitchInsnNode}. - * + * * @param min * the minimum key value. * @param max @@ -111,4 +111,4 @@ public AbstractInsnNode clone(final Map labels) { return new TableSwitchInsnNode(min, max, clone(dflt, labels), clone( this.labels, labels)).cloneAnnotations(this); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java index c639b9a..7a33a9f 100644 --- a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java +++ b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java @@ -27,15 +27,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.List; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a try catch block. - * + * * @author Eric Bruneton */ public class TryCatchBlockNode { @@ -65,8 +65,8 @@ public class TryCatchBlockNode { * The runtime visible type annotations on the exception handler type. This * list is a list of {@link TypeAnnotationNode} objects. May be * null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -75,15 +75,15 @@ public class TryCatchBlockNode { * The runtime invisible type annotations on the exception handler type. * This list is a list of {@link TypeAnnotationNode} objects. May be * null. - * - * @associates scala.tools.asm.tree.TypeAnnotationNode + * + * @associates org.objectweb.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; /** * Constructs a new {@link TryCatchBlockNode}. - * + * * @param start * beginning of the exception handler's scope (inclusive). * @param end @@ -107,7 +107,7 @@ public TryCatchBlockNode(final LabelNode start, final LabelNode end, * Updates the index of this try catch block in the method's list of try * catch block nodes. This index maybe stored in the 'target' field of the * type annotations of this block. - * + * * @param index * the new index of this try catch block in the method's list of * try catch block nodes. @@ -128,7 +128,7 @@ public void updateIndex(final int index) { /** * Makes the given visitor visit this try catch block. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java index 73b2962..93228b0 100644 --- a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java @@ -27,15 +27,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; -import scala.tools.asm.TypeReference; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; +import org.objectweb.asm.TypeReference; /** * A node that represents a type annotationn. - * + * * @author Eric Bruneton */ public class TypeAnnotationNode extends AnnotationNode { @@ -56,7 +56,7 @@ public class TypeAnnotationNode extends AnnotationNode { * Constructs a new {@link AnnotationNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #TypeAnnotationNode(int, int, TypePath, String)} version. - * + * * @param typeRef * a reference to the annotated type. See {@link TypeReference}. * @param typePath @@ -78,7 +78,7 @@ public TypeAnnotationNode(final int typeRef, final TypePath typePath, /** * Constructs a new {@link AnnotationNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. diff --git a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java index 401400c..859b57c 100644 --- a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java @@ -27,35 +27,35 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a type instruction. A type instruction is an * instruction that takes a type descriptor as parameter. - * + * * @author Eric Bruneton */ public class TypeInsnNode extends AbstractInsnNode { /** * The operand of this instruction. This operand is an internal name (see - * {@link scala.tools.asm.Type}). + * {@link org.objectweb.asm.Type}). */ public String desc; /** * Constructs a new {@link TypeInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be NEW, ANEWARRAY, CHECKCAST or INSTANCEOF. * @param desc * the operand of the instruction to be constructed. This operand - * is an internal name (see {@link scala.tools.asm.Type}). + * is an internal name (see {@link org.objectweb.asm.Type}). */ public TypeInsnNode(final int opcode, final String desc) { super(opcode); @@ -64,7 +64,7 @@ public TypeInsnNode(final int opcode, final String desc) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be NEW, * ANEWARRAY, CHECKCAST or INSTANCEOF. @@ -88,4 +88,4 @@ public void accept(final MethodVisitor mv) { public AbstractInsnNode clone(final Map labels) { return new TypeInsnNode(opcode, desc).cloneAnnotations(this); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/VarInsnNode.java b/src/main/java/scala/tools/asm/tree/VarInsnNode.java index 685e4fc..d813d6e 100644 --- a/src/main/java/scala/tools/asm/tree/VarInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/VarInsnNode.java @@ -27,17 +27,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree; +package org.objectweb.asm.tree; import java.util.Map; -import scala.tools.asm.MethodVisitor; +import org.objectweb.asm.MethodVisitor; /** * A node that represents a local variable instruction. A local variable * instruction is an instruction that loads or stores the value of a local * variable. - * + * * @author Eric Bruneton */ public class VarInsnNode extends AbstractInsnNode { @@ -50,7 +50,7 @@ public class VarInsnNode extends AbstractInsnNode { /** * Constructs a new {@link VarInsnNode}. - * + * * @param opcode * the opcode of the local variable instruction to be * constructed. This opcode must be ILOAD, LLOAD, FLOAD, DLOAD, @@ -66,7 +66,7 @@ public VarInsnNode(final int opcode, final int var) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be ILOAD, LLOAD, * FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or @@ -91,4 +91,4 @@ public void accept(final MethodVisitor mv) { public AbstractInsnNode clone(final Map labels) { return new VarInsnNode(opcode, var).cloneAnnotations(this); } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java index 7577c67..381e8af 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java @@ -27,33 +27,33 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.tree.AbstractInsnNode; -import scala.tools.asm.tree.IincInsnNode; -import scala.tools.asm.tree.InsnList; -import scala.tools.asm.tree.JumpInsnNode; -import scala.tools.asm.tree.LabelNode; -import scala.tools.asm.tree.LookupSwitchInsnNode; -import scala.tools.asm.tree.MethodNode; -import scala.tools.asm.tree.TableSwitchInsnNode; -import scala.tools.asm.tree.TryCatchBlockNode; -import scala.tools.asm.tree.VarInsnNode; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.IincInsnNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.JumpInsnNode; +import org.objectweb.asm.tree.LabelNode; +import org.objectweb.asm.tree.LookupSwitchInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.TableSwitchInsnNode; +import org.objectweb.asm.tree.TryCatchBlockNode; +import org.objectweb.asm.tree.VarInsnNode; /** * A semantic bytecode analyzer. This class does not fully check that JSR and * RET instructions are valid. - * + * * @param * type of the Value used for the analysis. - * + * * @author Eric Bruneton */ public class Analyzer implements Opcodes { @@ -78,7 +78,7 @@ public class Analyzer implements Opcodes { /** * Constructs a new {@link Analyzer}. - * + * * @param interpreter * the interpreter to be used to symbolically interpret the * bytecode instructions. @@ -89,7 +89,7 @@ public Analyzer(final Interpreter interpreter) { /** * Analyzes the given method. - * + * * @param owner * the internal name of the class to which the method belongs. * @param m @@ -158,26 +158,21 @@ public Frame[] analyze(final String owner, final MethodNode m) // initializes the data structures for the control flow analysis Frame current = newFrame(m.maxLocals, m.maxStack); Frame handler = newFrame(m.maxLocals, m.maxStack); - current.setReturn(interpreter.newReturnTypeValue(Type.getReturnType(m.desc))); + current.setReturn(interpreter.newValue(Type.getReturnType(m.desc))); Type[] args = Type.getArgumentTypes(m.desc); int local = 0; - boolean isInstanceMethod = (m.access & ACC_STATIC) == 0; - if (isInstanceMethod) { + if ((m.access & ACC_STATIC) == 0) { Type ctype = Type.getObjectType(owner); - current.setLocal(local, interpreter.newParameterValue(isInstanceMethod, local, ctype)); - local++; + current.setLocal(local++, interpreter.newValue(ctype)); } for (int i = 0; i < args.length; ++i) { - current.setLocal(local, interpreter.newParameterValue(isInstanceMethod, local, args[i])); - local++; + current.setLocal(local++, interpreter.newValue(args[i])); if (args[i].getSize() == 2) { - current.setLocal(local, interpreter.newEmptyValueAfterSize2Local(local)); - local++; + current.setLocal(local++, interpreter.newValue(null)); } } while (local < m.maxLocals) { - current.setLocal(local, interpreter.newEmptyNonParameterLocalValue(local)); - local++; + current.setLocal(local++, interpreter.newValue(null)); } merge(0, current, null); @@ -290,7 +285,7 @@ public Frame[] analyze(final String owner, final MethodNode m) if (newControlFlowExceptionEdge(insn, tcb)) { handler.init(f); handler.clearStack(); - handler.push(interpreter.newExceptionValue(tcb, handler, type)); + handler.push(interpreter.newValue(type)); merge(jump, handler, subroutine); } } @@ -376,12 +371,12 @@ private void findSubroutine(int insn, final Subroutine sub, /** * Returns the symbolic stack frame for each instruction of the last * recently analyzed method. - * + * * @return the symbolic state of the execution stack frame at each bytecode * instruction of the method. The size of the returned array is * equal to the number of instructions (and labels) of the method. A * given frame is null if the corresponding instruction - * cannot be reached, or if an error occurred during the analysis of + * cannot be reached, or if an error occured during the analysis of * the method. */ public Frame[] getFrames() { @@ -390,7 +385,7 @@ public Frame[] getFrames() { /** * Returns the exception handlers for the given instruction. - * + * * @param insn * the index of an instruction of the last recently analyzed * method. @@ -404,7 +399,7 @@ public List getHandlers(final int insn) { * Initializes this analyzer. This method is called just before the * execution of control flow analysis loop in #analyze. The default * implementation of this method does nothing. - * + * * @param owner * the internal name of the class to which the method belongs. * @param m @@ -417,7 +412,7 @@ protected void init(String owner, MethodNode m) throws AnalyzerException { /** * Constructs a new frame with the given size. - * + * * @param nLocals * the maximum number of local variables of the frame. * @param nStack @@ -430,7 +425,7 @@ protected Frame newFrame(final int nLocals, final int nStack) { /** * Constructs a new frame that is identical to the given frame. - * + * * @param src * a frame. * @return the created frame. @@ -441,10 +436,10 @@ protected Frame newFrame(final Frame src) { /** * Creates a control flow graph edge. The default implementation of this - * method does nothing. It can be overridden in order to construct the + * method does nothing. It can be overriden in order to construct the * control flow graph of a method (this method is called by the * {@link #analyze analyze} method during its visit of the method's code). - * + * * @param insn * an instruction index. * @param successor @@ -459,7 +454,7 @@ protected void newControlFlowEdge(final int insn, final int successor) { * overridden in order to construct the control flow graph of a method (this * method is called by the {@link #analyze analyze} method during its visit * of the method's code). - * + * * @param insn * an instruction index. * @param successor @@ -481,7 +476,7 @@ protected boolean newControlFlowExceptionEdge(final int insn, * construct the control flow graph of a method (this method is called by * the {@link #analyze analyze} method during its visit of the method's * code). - * + * * @param insn * an instruction index. * @param tcb diff --git a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java index 52b2a11..6487912 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java +++ b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java @@ -27,13 +27,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; -import scala.tools.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.AbstractInsnNode; /** * Thrown if a problem occurs during the analysis of a method. - * + * * @author Bing Ran * @author Eric Bruneton */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java index 7d0b7b0..7db7ce6 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java @@ -27,25 +27,25 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.List; -import scala.tools.asm.Handle; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.tree.AbstractInsnNode; -import scala.tools.asm.tree.FieldInsnNode; -import scala.tools.asm.tree.IntInsnNode; -import scala.tools.asm.tree.InvokeDynamicInsnNode; -import scala.tools.asm.tree.LdcInsnNode; -import scala.tools.asm.tree.MethodInsnNode; -import scala.tools.asm.tree.MultiANewArrayInsnNode; -import scala.tools.asm.tree.TypeInsnNode; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.IntInsnNode; +import org.objectweb.asm.tree.InvokeDynamicInsnNode; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MultiANewArrayInsnNode; +import org.objectweb.asm.tree.TypeInsnNode; /** * An {@link Interpreter} for {@link BasicValue} values. - * + * * @author Eric Bruneton * @author Bing Ran */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java index 439941f..78316ae 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java @@ -27,15 +27,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; -import scala.tools.asm.Type; +import org.objectweb.asm.Type; /** * A {@link Value} that is represented by its type in a seven types type system. * This type system distinguishes the UNINITIALZED, INT, FLOAT, LONG, DOUBLE, * REFERENCE and RETURNADDRESS types. - * + * * @author Eric Bruneton */ public class BasicValue implements Value { diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java index b852f20..a542247 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java @@ -27,20 +27,20 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.List; -import scala.tools.asm.Type; -import scala.tools.asm.tree.AbstractInsnNode; -import scala.tools.asm.tree.FieldInsnNode; -import scala.tools.asm.tree.InvokeDynamicInsnNode; -import scala.tools.asm.tree.MethodInsnNode; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.InvokeDynamicInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; /** * An extended {@link BasicInterpreter} that checks that bytecode instructions * are correctly used. - * + * * @author Eric Bruneton * @author Bing Ran */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/Frame.java b/src/main/java/scala/tools/asm/tree/analysis/Frame.java index 8257065..5047bf7 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Frame.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Frame.java @@ -27,29 +27,29 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.ArrayList; import java.util.List; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.tree.AbstractInsnNode; -import scala.tools.asm.tree.IincInsnNode; -import scala.tools.asm.tree.InvokeDynamicInsnNode; -import scala.tools.asm.tree.MethodInsnNode; -import scala.tools.asm.tree.MultiANewArrayInsnNode; -import scala.tools.asm.tree.VarInsnNode; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.IincInsnNode; +import org.objectweb.asm.tree.InvokeDynamicInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MultiANewArrayInsnNode; +import org.objectweb.asm.tree.VarInsnNode; /** * A symbolic execution stack frame. A stack frame contains a set of local * variable slots, and an operand stack. Warning: long and double values are * represented by two slots in local variables, and by one slot in * the operand stack. - * + * * @param * type of the Value used for the analysis. - * + * * @author Eric Bruneton */ public class Frame { @@ -77,7 +77,7 @@ public class Frame { /** * Constructs a new frame with the given size. - * + * * @param nLocals * the maximum number of local variables of the frame. * @param nStack @@ -91,7 +91,7 @@ public Frame(final int nLocals, final int nStack) { /** * Constructs a new frame that is identical to the given frame. - * + * * @param src * a frame. */ @@ -102,7 +102,7 @@ public Frame(final Frame src) { /** * Copies the state of the given frame into this frame. - * + * * @param src * a frame. * @return this frame. @@ -116,7 +116,7 @@ public Frame init(final Frame src) { /** * Sets the expected return type of the analyzed method. - * + * * @param v * the expected return type of the analyzed method, or * null if the method returns void. @@ -127,7 +127,7 @@ public void setReturn(final V v) { /** * Returns the maximum number of local variables of this frame. - * + * * @return the maximum number of local variables of this frame. */ public int getLocals() { @@ -136,16 +136,16 @@ public int getLocals() { /** * Returns the maximum stack size of this frame. - * + * * @return the maximum stack size of this frame. */ public int getMaxStackSize() { return values.length - locals; } - + /** * Returns the value of the given local variable. - * + * * @param i * a local variable index. * @return the value of the given local variable. @@ -162,7 +162,7 @@ public V getLocal(final int i) throws IndexOutOfBoundsException { /** * Sets the value of the given local variable. - * + * * @param i * a local variable index. * @param value @@ -182,7 +182,7 @@ public void setLocal(final int i, final V value) /** * Returns the number of values in the operand stack of this frame. Long and * double values are treated as single values. - * + * * @return the number of values in the operand stack of this frame. */ public int getStackSize() { @@ -191,7 +191,7 @@ public int getStackSize() { /** * Returns the value of the given operand stack slot. - * + * * @param i * the index of an operand stack slot. * @return the value of the given operand stack slot. @@ -202,20 +202,6 @@ public V getStack(final int i) throws IndexOutOfBoundsException { return values[i + locals]; } - /** - * Sets the value of the given stack slot. - * - * @param i - * the index of an operand stack slot. - * @param value - * the new value of the stack slot. - * @throws IndexOutOfBoundsException - * if the stack slot does not exist. - */ - public void setStack(final int i, final V value) throws IndexOutOfBoundsException { - values[i + locals] = value; - } - /** * Clears the operand stack of this frame. */ @@ -225,7 +211,7 @@ public void clearStack() { /** * Pops a value from the operand stack of this frame. - * + * * @return the value that has been popped from the stack. * @throws IndexOutOfBoundsException * if the operand stack is empty. @@ -240,7 +226,7 @@ public V pop() throws IndexOutOfBoundsException { /** * Pushes a value into the operand stack of this frame. - * + * * @param value * the value that must be pushed into the stack. * @throws IndexOutOfBoundsException @@ -312,12 +298,12 @@ public void execute(final AbstractInsnNode insn, var = ((VarInsnNode) insn).var; setLocal(var, value1); if (value1.getSize() == 2) { - setLocal(var + 1, interpreter.newEmptyValueAfterSize2Local(var + 1)); + setLocal(var + 1, interpreter.newValue(null)); } if (var > 0) { Value local = getLocal(var - 1); if (local != null && local.getSize() == 2) { - setLocal(var - 1, interpreter.newEmptyValueForPreviousSize2Local(var - 1)); + setLocal(var - 1, interpreter.newValue(null)); } } break; @@ -351,7 +337,7 @@ public void execute(final AbstractInsnNode insn, if (value1.getSize() != 1) { throw new AnalyzerException(insn, "Illegal use of DUP"); } - push(interpreter.copyOperation(insn, value1)); + push(value1); push(interpreter.copyOperation(insn, value1)); break; case Opcodes.DUP_X1: @@ -361,8 +347,8 @@ public void execute(final AbstractInsnNode insn, throw new AnalyzerException(insn, "Illegal use of DUP_X1"); } push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value2); + push(value1); break; case Opcodes.DUP_X2: value1 = pop(); @@ -372,15 +358,15 @@ public void execute(final AbstractInsnNode insn, value3 = pop(); if (value3.getSize() == 1) { push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value3)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value3); + push(value2); + push(value1); break; } } else { push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value2); + push(value1); break; } } @@ -390,14 +376,14 @@ public void execute(final AbstractInsnNode insn, if (value1.getSize() == 1) { value2 = pop(); if (value2.getSize() == 1) { - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value2); + push(value1); push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); break; } } else { - push(interpreter.copyOperation(insn, value1)); + push(value1); push(interpreter.copyOperation(insn, value1)); break; } @@ -411,9 +397,9 @@ public void execute(final AbstractInsnNode insn, if (value3.getSize() == 1) { push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value3)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value3); + push(value2); + push(value1); break; } } @@ -421,8 +407,8 @@ public void execute(final AbstractInsnNode insn, value2 = pop(); if (value2.getSize() == 1) { push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value2); + push(value1); break; } } @@ -438,18 +424,18 @@ public void execute(final AbstractInsnNode insn, if (value4.getSize() == 1) { push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value4)); - push(interpreter.copyOperation(insn, value3)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value4); + push(value3); + push(value2); + push(value1); break; } } else { push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value3)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value3); + push(value2); + push(value1); break; } } @@ -459,15 +445,15 @@ public void execute(final AbstractInsnNode insn, value3 = pop(); if (value3.getSize() == 1) { push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value3)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value3); + push(value2); + push(value1); break; } } else { push(interpreter.copyOperation(insn, value1)); - push(interpreter.copyOperation(insn, value2)); - push(interpreter.copyOperation(insn, value1)); + push(value2); + push(value1); break; } } @@ -685,7 +671,7 @@ public void execute(final AbstractInsnNode insn, /** * Merges this frame with the given frame. - * + * * @param frame * a frame. * @param interpreter @@ -713,7 +699,7 @@ public boolean merge(final Frame frame, /** * Merges this frame with the given frame (case of a RET instruction). - * + * * @param frame * a frame * @param access @@ -735,7 +721,7 @@ public boolean merge(final Frame frame, final boolean[] access) { /** * Returns a string representation of this frame. - * + * * @return a string representation of this frame. */ @Override diff --git a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java index 43104b4..94e08ea 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java @@ -27,13 +27,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.List; -import scala.tools.asm.Type; -import scala.tools.asm.tree.AbstractInsnNode; -import scala.tools.asm.tree.TryCatchBlockNode; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; /** * A semantic bytecode interpreter. More precisely, this interpreter only @@ -42,10 +41,10 @@ * This separation allows a generic bytecode {@link Analyzer} to work with * various semantic interpreters, without needing to duplicate the code to * simulate the transfer of values. - * + * * @param * type of the Value used for the analysis. - * + * * @author Eric Bruneton */ public abstract class Interpreter { @@ -58,11 +57,11 @@ protected Interpreter(final int api) { /** * Creates a new value that represents the given type. - * + * * Called for method parameters (including this), exception * handler variable and with null type for variables reserved * by long and double types. - * + * * @param type * a primitive or reference type, or null to represent * an uninitialized value. @@ -71,68 +70,19 @@ protected Interpreter(final int api) { */ public abstract V newValue(Type type); - /** - * Called by the analyzer for initializing the return type value of a frame. - */ - public V newReturnTypeValue(Type type) { - return newValue(type); - } - - /** - * Called by the analyzer when initializing the value of a parameter in a frame. - */ - public V newParameterValue(boolean isInstanceMethod, int local, Type type) { - return newValue(type); - } - - /** - * Called by the analyzer when initializing a non-parameter local in a frame. - * This method has to return a size-1 value representing an empty slot. - */ - public V newEmptyNonParameterLocalValue(int local) { - return newValue(null); - } - - /** - * Called by the analyzer and the interpreter. When initializing or setting the value of a - * size-2 local, the value of the subsequent slot is reset using this method. - * This method has to return a size-1 value representing an empty slot. - */ - public V newEmptyValueAfterSize2Local(int local) { - return newValue(null); - } - - /** - * Called by the interpreter. When setting the value of a local variable, the interpreter checks - * whether the current value stored at the preceding index is of size-2. In this case, the - * preceding size-2 value is no longer valid and reset using this method. - * This method has to return a size-1 value representing an empty slot. - */ - public V newEmptyValueForPreviousSize2Local(int local) { - return newValue(null); - } - - /** - * Called by the analyzer when initializing the exception value on the call stack at the entry - * of an exception handler. - */ - public V newExceptionValue(TryCatchBlockNode tryCatchBlockNode, Frame handlerFrame, Type exceptionType) { - return newValue(exceptionType); - } - /** * Interprets a bytecode instruction without arguments. This method is * called for the following opcodes: - * + * * ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, * ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, * DCONST_1, BIPUSH, SIPUSH, LDC, JSR, GETSTATIC, NEW - * + * * @param insn * the bytecode instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occurred during the interpretation. + * if an error occured during the interpretation. */ public abstract V newOperation(AbstractInsnNode insn) throws AnalyzerException; @@ -140,10 +90,10 @@ public abstract V newOperation(AbstractInsnNode insn) /** * Interprets a bytecode instruction that moves a value on the stack or to * or from local variables. This method is called for the following opcodes: - * + * * ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, * ASTORE, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP - * + * * @param insn * the bytecode instruction to be interpreted. * @param value @@ -151,7 +101,7 @@ public abstract V newOperation(AbstractInsnNode insn) * @return the result of the interpretation of the given instruction. The * returned value must be equal to the given value. * @throws AnalyzerException - * if an error occurred during the interpretation. + * if an error occured during the interpretation. */ public abstract V copyOperation(AbstractInsnNode insn, V value) throws AnalyzerException; @@ -159,20 +109,20 @@ public abstract V copyOperation(AbstractInsnNode insn, V value) /** * Interprets a bytecode instruction with a single argument. This method is * called for the following opcodes: - * + * * INEG, LNEG, FNEG, DNEG, IINC, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, * F2D, D2I, D2L, D2F, I2B, I2C, I2S, IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, * TABLESWITCH, LOOKUPSWITCH, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN, * PUTSTATIC, GETFIELD, NEWARRAY, ANEWARRAY, ARRAYLENGTH, ATHROW, CHECKCAST, * INSTANCEOF, MONITORENTER, MONITOREXIT, IFNULL, IFNONNULL - * + * * @param insn * the bytecode instruction to be interpreted. * @param value * the argument of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occurred during the interpretation. + * if an error occured during the interpretation. */ public abstract V unaryOperation(AbstractInsnNode insn, V value) throws AnalyzerException; @@ -180,14 +130,14 @@ public abstract V unaryOperation(AbstractInsnNode insn, V value) /** * Interprets a bytecode instruction with two arguments. This method is * called for the following opcodes: - * + * * IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IADD, * LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, * LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, ISHL, LSHL, ISHR, LSHR, IUSHR, * LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, LCMP, FCMPL, FCMPG, DCMPL, * DCMPG, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, * IF_ACMPEQ, IF_ACMPNE, PUTFIELD - * + * * @param insn * the bytecode instruction to be interpreted. * @param value1 @@ -196,7 +146,7 @@ public abstract V unaryOperation(AbstractInsnNode insn, V value) * the second argument of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occurred during the interpretation. + * if an error occured during the interpretation. */ public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2) throws AnalyzerException; @@ -204,9 +154,9 @@ public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2) /** * Interprets a bytecode instruction with three arguments. This method is * called for the following opcodes: - * + * * IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE - * + * * @param insn * the bytecode instruction to be interpreted. * @param value1 @@ -217,7 +167,7 @@ public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2) * the third argument of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occurred during the interpretation. + * if an error occured during the interpretation. */ public abstract V ternaryOperation(AbstractInsnNode insn, V value1, V value2, V value3) throws AnalyzerException; @@ -225,17 +175,17 @@ public abstract V ternaryOperation(AbstractInsnNode insn, V value1, /** * Interprets a bytecode instruction with a variable number of arguments. * This method is called for the following opcodes: - * + * * INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC, INVOKEINTERFACE, * MULTIANEWARRAY and INVOKEDYNAMIC - * + * * @param insn * the bytecode instruction to be interpreted. * @param values * the arguments of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occurred during the interpretation. + * if an error occured during the interpretation. */ public abstract V naryOperation(AbstractInsnNode insn, List values) throws AnalyzerException; @@ -243,9 +193,9 @@ public abstract V naryOperation(AbstractInsnNode insn, /** * Interprets a bytecode return instruction. This method is called for the * following opcodes: - * + * * IRETURN, LRETURN, FRETURN, DRETURN, ARETURN - * + * * @param insn * the bytecode instruction to be interpreted. * @param value @@ -253,7 +203,7 @@ public abstract V naryOperation(AbstractInsnNode insn, * @param expected * the expected return type of the analyzed method. * @throws AnalyzerException - * if an error occurred during the interpretation. + * if an error occured during the interpretation. */ public abstract void returnOperation(AbstractInsnNode insn, V value, V expected) throws AnalyzerException; @@ -264,7 +214,7 @@ public abstract void returnOperation(AbstractInsnNode insn, V value, * the merged value must be a common super type of the two types. If the two * values are integer intervals, the merged value must be an interval that * contains the previous ones. Likewise for other types of values). - * + * * @param v * a value. * @param w diff --git a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java index a345981..c8ee087 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java @@ -27,17 +27,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.List; -import scala.tools.asm.Type; +import org.objectweb.asm.Type; /** * An extended {@link BasicVerifier} that performs more precise verifications. * This verifier computes exact class types, instead of using a single "object * reference" type (as done in the {@link BasicVerifier}). - * + * * @author Eric Bruneton * @author Bing Ran */ @@ -78,7 +78,7 @@ public SimpleVerifier() { /** * Constructs a new {@link SimpleVerifier} to verify a specific class. This * class will not be loaded into the JVM since it may be incorrect. - * + * * @param currentClass * the class that is verified. * @param currentSuperClass @@ -94,7 +94,7 @@ public SimpleVerifier(final Type currentClass, /** * Constructs a new {@link SimpleVerifier} to verify a specific class. This * class will not be loaded into the JVM since it may be incorrect. - * + * * @param currentClass * the class that is verified. * @param currentSuperClass @@ -125,7 +125,7 @@ protected SimpleVerifier(final int api, final Type currentClass, * Set the ClassLoader which will be used to load referenced * classes. This is useful if you are verifying multiple interdependent * classes. - * + * * @param loader * a ClassLoader to use */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java b/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java index 205878d..0cf6ccf 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.AbstractSet; import java.util.HashSet; @@ -37,7 +37,7 @@ /** * A set of at most two elements. - * + * * @author Eric Bruneton */ class SmallSet extends AbstractSet implements Iterator { diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java index 7d739d3..a5531df 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java @@ -27,23 +27,23 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.HashSet; import java.util.List; import java.util.Set; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.tree.AbstractInsnNode; -import scala.tools.asm.tree.FieldInsnNode; -import scala.tools.asm.tree.InvokeDynamicInsnNode; -import scala.tools.asm.tree.LdcInsnNode; -import scala.tools.asm.tree.MethodInsnNode; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.InvokeDynamicInsnNode; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; /** * An {@link Interpreter} for {@link SourceValue} values. - * + * * @author Eric Bruneton */ public class SourceInterpreter extends Interpreter implements diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java index 40d6b68..f87fc9e 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java @@ -27,16 +27,16 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.Set; -import scala.tools.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.AbstractInsnNode; /** * A {@link Value} that is represented by its type in a two types type system. * This type system distinguishes the ONEWORD and TWOWORDS types. - * + * * @author Eric Bruneton */ public class SourceValue implements Value { @@ -50,7 +50,7 @@ public class SourceValue implements Value { * The instructions that can produce this value. For example, for the Java * code below, the instructions that can produce the value of i at * line 5 are the txo ISTORE instructions at line 1 and 3: - * + * *
      * 1: i = 0;
      * 2: if (...) {
@@ -58,7 +58,7 @@ public class SourceValue implements Value {
      * 4: }
      * 5: return i;
      * 
- * + * * This field is a set of {@link AbstractInsnNode} objects. */ public final Set insns; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java index d734bbd..2739671 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java @@ -27,17 +27,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; import java.util.ArrayList; import java.util.List; -import scala.tools.asm.tree.JumpInsnNode; -import scala.tools.asm.tree.LabelNode; +import org.objectweb.asm.tree.JumpInsnNode; +import org.objectweb.asm.tree.LabelNode; /** * A method subroutine (corresponds to a JSR instruction). - * + * * @author Eric Bruneton */ class Subroutine { @@ -87,4 +87,4 @@ public boolean merge(final Subroutine subroutine) throws AnalyzerException { } return changes; } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/tree/analysis/Value.java b/src/main/java/scala/tools/asm/tree/analysis/Value.java index 1edf475..7545dce 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Value.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Value.java @@ -27,18 +27,18 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.tree.analysis; +package org.objectweb.asm.tree.analysis; /** * An immutable symbolic value for semantic interpretation of bytecode. - * + * * @author Eric Bruneton */ public interface Value { /** * Returns the size of this value in words. - * + * * @return either 1 or 2. */ int getSize(); diff --git a/src/main/java/scala/tools/asm/util/ASMifiable.java b/src/main/java/scala/tools/asm/util/ASMifiable.java index 95cc6e3..dcefe67 100644 --- a/src/main/java/scala/tools/asm/util/ASMifiable.java +++ b/src/main/java/scala/tools/asm/util/ASMifiable.java @@ -27,23 +27,23 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.util.Map; -import scala.tools.asm.Label; +import org.objectweb.asm.Label; /** - * An {@link scala.tools.asm.Attribute Attribute} that can print the ASM code + * An {@link org.objectweb.asm.Attribute Attribute} that can print the ASM code * to create an equivalent attribute. - * + * * @author Eugene Kuleshov */ public interface ASMifiable { /** * Prints the ASM code to create an attribute equal to this attribute. - * + * * @param buf * a buffer used for printing Java code. * @param varName diff --git a/src/main/java/scala/tools/asm/util/ASMifier.java b/src/main/java/scala/tools/asm/util/ASMifier.java index 521e075..aea8554 100644 --- a/src/main/java/scala/tools/asm/util/ASMifier.java +++ b/src/main/java/scala/tools/asm/util/ASMifier.java @@ -27,24 +27,24 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.io.FileInputStream; import java.io.PrintWriter; import java.util.HashMap; import java.util.Map; -import scala.tools.asm.Attribute; -import scala.tools.asm.ClassReader; -import scala.tools.asm.Handle; -import scala.tools.asm.Label; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.TypePath; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Label; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.TypePath; /** * A {@link Printer} that prints the ASM code to generate the classes if visits. - * + * * @author Eric Bruneton */ public class ASMifier extends Printer { @@ -84,7 +84,7 @@ public class ASMifier extends Printer { * Constructs a new {@link ASMifier}. Subclasses must not use this * constructor. Instead, they must use the * {@link #ASMifier(int, String, int)} version. - * + * * @throws IllegalStateException * If a subclass calls this constructor. */ @@ -97,7 +97,7 @@ public ASMifier() { /** * Constructs a new {@link ASMifier}. - * + * * @param api * the ASM API version implemented by this class. Must be one of * {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -118,10 +118,10 @@ protected ASMifier(final int api, final String name, final int id) { * output. *

* Usage: ASMifier [-debug] <binary class name or class file name> - * + * * @param args * the command line arguments. - * + * * @throws Exception * if the class cannot be found, or if an IO exception occurs. */ @@ -176,7 +176,7 @@ public void visit(final int version, final int access, final String name, simpleName = name.substring(n + 1); } text.add("import java.util.*;\n"); - text.add("import scala.tools.asm.*;\n"); + text.add("import org.objectweb.asm.*;\n"); text.add("public class " + simpleName + "Dump implements Opcodes {\n\n"); text.add("public static byte[] dump () throws Exception {\n\n"); text.add("ClassWriter cw = new ClassWriter(0);\n"); @@ -827,7 +827,11 @@ public Printer visitLocalVariableAnnotation(int typeRef, TypePath typePath, buf.append("{\n").append("av0 = ").append(name) .append(".visitLocalVariableAnnotation("); buf.append(typeRef); - buf.append(", TypePath.fromString(\"").append(typePath).append("\"), "); + if (typePath == null) { + buf.append(", null, "); + } else { + buf.append(", TypePath.fromString(\"").append(typePath).append("\"), "); + } buf.append("new Label[] {"); for (int i = 0; i < start.length; ++i) { buf.append(i == 0 ? " " : ", "); @@ -905,7 +909,11 @@ public ASMifier visitTypeAnnotation(final String method, final int typeRef, buf.append("{\n").append("av0 = ").append(name).append(".") .append(method).append("("); buf.append(typeRef); - buf.append(", TypePath.fromString(\"").append(typePath).append("\"), "); + if (typePath == null) { + buf.append(", null, "); + } else { + buf.append(", TypePath.fromString(\"").append(typePath).append("\"), "); + } appendConstant(desc); buf.append(", ").append(visible).append(");\n"); text.add(buf.toString()); @@ -941,7 +949,7 @@ protected ASMifier createASMifier(final String name, final int id) { /** * Appends a string representation of the given access modifiers to * {@link #buf buf}. - * + * * @param access * some access modifiers. */ @@ -1091,7 +1099,7 @@ void appendAccess(final int access) { /** * Appends a string representation of the given constant to the given * buffer. - * + * * @param cst * an {@link Integer}, {@link Float}, {@link Long}, * {@link Double} or {@link String} object. May be null. @@ -1103,7 +1111,7 @@ protected void appendConstant(final Object cst) { /** * Appends a string representation of the given constant to the given * buffer. - * + * * @param buf * a string buffer. * @param cst @@ -1254,7 +1262,7 @@ private void appendFrameTypes(final int n, final Object[] o) { * Appends a declaration of the given label to {@link #buf buf}. This * declaration is of the form "Label lXXX = new Label();". Does nothing if * the given label has already been declared. - * + * * @param l * a label. */ @@ -1274,7 +1282,7 @@ protected void declareLabel(final Label l) { * Appends the name of the given label to {@link #buf buf}. The given label * must already have a name. One way to ensure this is to always call * {@link #declareLabel declared} before calling this method. - * + * * @param l * a label. */ diff --git a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java index 70441d1..d9c0bdd 100644 --- a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java @@ -27,15 +27,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; /** * An {@link AnnotationVisitor} that checks that its methods are properly used. - * + * * @author Eric Bruneton */ public class CheckAnnotationAdapter extends AnnotationVisitor { diff --git a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java index 88afdb0..210e238 100644 --- a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.io.FileInputStream; import java.io.PrintWriter; @@ -37,23 +37,23 @@ import java.util.List; import java.util.Map; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.ClassReader; -import scala.tools.asm.ClassVisitor; -import scala.tools.asm.FieldVisitor; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.TypePath; -import scala.tools.asm.TypeReference; -import scala.tools.asm.tree.ClassNode; -import scala.tools.asm.tree.MethodNode; -import scala.tools.asm.tree.analysis.Analyzer; -import scala.tools.asm.tree.analysis.BasicValue; -import scala.tools.asm.tree.analysis.Frame; -import scala.tools.asm.tree.analysis.SimpleVerifier; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.TypePath; +import org.objectweb.asm.TypeReference; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.analysis.Analyzer; +import org.objectweb.asm.tree.analysis.BasicValue; +import org.objectweb.asm.tree.analysis.Frame; +import org.objectweb.asm.tree.analysis.SimpleVerifier; /** * A {@link ClassVisitor} that checks that its methods are properly used. More @@ -62,36 +62,36 @@ * of method calls. For example, the invalid sequence * visitField(ACC_PUBLIC, "i", "I", null) visitField(ACC_PUBLIC, * "i", "D", null) will not be detected by this class adapter. - * + * *

* CheckClassAdapter can be also used to verify bytecode * transformations in order to make sure transformed bytecode is sane. For * example: - * + * *

  *   InputStream is = ...; // get bytes for the source class
  *   ClassReader cr = new ClassReader(is);
  *   ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
  *   ClassVisitor cv = new MyClassAdapter(new CheckClassAdapter(cw));
  *   cr.accept(cv, 0);
- *
+ * 
  *   StringWriter sw = new StringWriter();
  *   PrintWriter pw = new PrintWriter(sw);
  *   CheckClassAdapter.verify(new ClassReader(cw.toByteArray()), false, pw);
  *   assertTrue(sw.toString(), sw.toString().length()==0);
  * 
- * + * * Above code runs transformed bytecode trough the * CheckClassAdapter. It won't be exactly the same verification as * JVM does, but it run data flow analysis for the code of each method and * checks that expectations are met for each method instruction. - * + * *

* If method bytecode has errors, assertion text will show the erroneous * instruction number and dump of the failed method with information about * locals and stack slot for each instruction. For example (format is - * insnNumber locals : stack): - * + * *

  * org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 71: Expected I, but found .
  *   at org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:289)
@@ -104,24 +104,24 @@
  *   ISTORE 2
  * 00001 LinkedBlockingQueue$Itr . I . . . . . .  :
  * ...
- *
+ * 
  * 00071 LinkedBlockingQueue$Itr . I . . . . . .  :
  *   ILOAD 1
  * 00072 ?
  *   INVOKESPECIAL java/lang/Integer.<init> (I)V
  * ...
  * 
- * + * * In the above output you can see that variable 1 loaded by * ILOAD 1 instruction at position 00071 is not * initialized. You can also see that at the beginning of the method (code * inserted by the transformation) variable 2 is initialized. - * + * *

* Note that when used like that, CheckClassAdapter.verify() can * trigger additional class loading, because it is using * SimpleVerifier. - * + * * @author Eric Bruneton */ public class CheckClassAdapter extends ClassVisitor { @@ -166,10 +166,10 @@ public class CheckClassAdapter extends ClassVisitor { * Checks a given class. *

* Usage: CheckClassAdapter <binary class name or class file name> - * + * * @param args * the command line arguments. - * + * * @throws Exception * if the class cannot be found, or if an IO exception occurs. */ @@ -192,7 +192,7 @@ public static void main(final String[] args) throws Exception { /** * Checks a given class. - * + * * @param cr * a ClassReader that contains bytecode for the * analysis. @@ -244,7 +244,7 @@ public static void verify(final ClassReader cr, final ClassLoader loader, /** * Checks a given class - * + * * @param cr * a ClassReader that contains bytecode for the * analysis. @@ -310,7 +310,7 @@ private static String getShortName(final String name) { * Constructs a new {@link CheckClassAdapter}. Subclasses must not use * this constructor. Instead, they must use the * {@link #CheckClassAdapter(int, ClassVisitor, boolean)} version. - * + * * @param cv * the class visitor to which this adapter must delegate calls. */ @@ -322,7 +322,7 @@ public CheckClassAdapter(final ClassVisitor cv) { * Constructs a new {@link CheckClassAdapter}. Subclasses must not use * this constructor. Instead, they must use the * {@link #CheckClassAdapter(int, ClassVisitor, boolean)} version. - * + * * @param cv * the class visitor to which this adapter must delegate calls. * @param checkDataFlow @@ -342,7 +342,7 @@ public CheckClassAdapter(final ClassVisitor cv, final boolean checkDataFlow) { /** * Constructs a new {@link CheckClassAdapter}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -588,7 +588,7 @@ private void checkState() { * Checks that the given access flags do not contain invalid flags. This * method also checks that mutually incompatible flags are not set * simultaneously. - * + * * @param access * the access flags to be checked * @param possibleAccess @@ -617,7 +617,7 @@ static void checkAccess(final int access, final int possibleAccess) { /** * Checks a class signature. - * + * * @param signature * a string containing the signature that must be checked. */ @@ -641,7 +641,7 @@ public static void checkClassSignature(final String signature) { /** * Checks a method signature. - * + * * @param signature * a string containing the signature that must be checked. */ @@ -680,7 +680,7 @@ public static void checkMethodSignature(final String signature) { /** * Checks a field signature. - * + * * @param signature * a string containing the signature that must be checked. */ @@ -694,7 +694,7 @@ public static void checkFieldSignature(final String signature) { /** * Checks the reference to a type in a type annotation. - * + * * @param typeRef * a reference to an annotated type. * @param typePath @@ -765,7 +765,7 @@ static void checkTypeRefAndPath(int typeRef, TypePath typePath) { /** * Checks the formal type parameters of a class or method signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -786,7 +786,7 @@ private static int checkFormalTypeParameters(final String signature, int pos) { /** * Checks a formal type parameter of a class or method signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -810,7 +810,7 @@ private static int checkFormalTypeParameter(final String signature, int pos) { /** * Checks a field type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -836,7 +836,7 @@ private static int checkFieldTypeSignature(final String signature, int pos) { /** * Checks a class type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -867,7 +867,7 @@ private static int checkClassTypeSignature(final String signature, int pos) { /** * Checks the type arguments in a class type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -888,7 +888,7 @@ private static int checkTypeArguments(final String signature, int pos) { /** * Checks a type argument in a class type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -910,7 +910,7 @@ private static int checkTypeArgument(final String signature, int pos) { /** * Checks a type variable signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -929,7 +929,7 @@ private static int checkTypeVariableSignature(final String signature, /** * Checks a type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -957,7 +957,7 @@ private static int checkTypeSignature(final String signature, int pos) { /** * Checks an identifier. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -978,7 +978,7 @@ private static int checkIdentifier(final String signature, int pos) { /** * Checks a single character. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -995,7 +995,7 @@ private static int checkChar(final char c, final String signature, int pos) { /** * Returns the signature car at the given index. - * + * * @param signature * a signature. * @param pos diff --git a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java index e682df4..0b2e0e5 100644 --- a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java @@ -27,14 +27,14 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.FieldVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; -import scala.tools.asm.TypeReference; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; +import org.objectweb.asm.TypeReference; /** * A {@link FieldVisitor} that checks that its methods are properly used. @@ -47,7 +47,7 @@ public class CheckFieldAdapter extends FieldVisitor { * Constructs a new {@link CheckFieldAdapter}. Subclasses must not use * this constructor. Instead, they must use the * {@link #CheckFieldAdapter(int, FieldVisitor)} version. - * + * * @param fv * the field visitor to which this adapter must delegate calls. * @throws IllegalStateException @@ -62,7 +62,7 @@ public CheckFieldAdapter(final FieldVisitor fv) { /** * Constructs a new {@link CheckFieldAdapter}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. diff --git a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java index 48d5c3c..63edb06 100644 --- a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.io.PrintWriter; import java.io.StringWriter; @@ -39,19 +39,19 @@ import java.util.Map; import java.util.Set; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.Handle; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.TypePath; -import scala.tools.asm.TypeReference; -import scala.tools.asm.tree.MethodNode; -import scala.tools.asm.tree.analysis.Analyzer; -import scala.tools.asm.tree.analysis.BasicValue; -import scala.tools.asm.tree.analysis.BasicVerifier; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.TypePath; +import org.objectweb.asm.TypeReference; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.analysis.Analyzer; +import org.objectweb.asm.tree.analysis.BasicValue; +import org.objectweb.asm.tree.analysis.BasicVerifier; /** * A {@link MethodVisitor} that checks that its methods are properly used. More @@ -60,13 +60,13 @@ * arguments - such as the fact that the given opcode is correct for a given * visit method. This adapter can also perform some basic data flow checks (more * precisely those that can be performed without the full class hierarchy - see - * {@link scala.tools.asm.tree.analysis.BasicVerifier}). For instance in a + * {@link org.objectweb.asm.tree.analysis.BasicVerifier}). For instance in a * method whose signature is void m (), the invalid instruction * IRETURN, or the invalid sequence IADD L2I will be detected if the data flow * checks are enabled. These checks are enabled by using the * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)} constructor. * They are not performed if any other constructor is used. - * + * * @author Eric Bruneton */ public class CheckMethodAdapter extends MethodVisitor { @@ -373,7 +373,7 @@ public class CheckMethodAdapter extends MethodVisitor { * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}). * Subclasses must not use this constructor. Instead, they must use * the {@link #CheckMethodAdapter(int, MethodVisitor, Map)} version. - * + * * @param mv * the method visitor to which this adapter must delegate calls. */ @@ -387,7 +387,7 @@ public CheckMethodAdapter(final MethodVisitor mv) { * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}). * Subclasses must not use this constructor. Instead, they must use * the {@link #CheckMethodAdapter(int, MethodVisitor, Map)} version. - * + * * @param mv * the method visitor to which this adapter must delegate calls. * @param labels @@ -407,7 +407,10 @@ public CheckMethodAdapter(final MethodVisitor mv, * Constructs a new {@link CheckMethodAdapter} object. This method adapter * will not perform any data flow check (see * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}). - * + * + * @param api + * the ASM API version implemented by this CheckMethodAdapter. + * Must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. * @param mv * the method visitor to which this adapter must delegate calls. * @param labels @@ -426,7 +429,7 @@ protected CheckMethodAdapter(final int api, final MethodVisitor mv, * will perform basic data flow checks. For instance in a method whose * signature is void m (), the invalid instruction IRETURN, or the * invalid sequence IADD L2I will be detected. - * + * * @param access * the method's access flags. * @param name @@ -1062,7 +1065,7 @@ void checkEndMethod() { /** * Checks a stack frame value. - * + * * @param value * the value to be checked. */ @@ -1087,7 +1090,7 @@ void checkFrameValue(final Object value) { /** * Checks that the type of the given opcode is equal to the given type. - * + * * @param opcode * the opcode to be checked. * @param type @@ -1101,7 +1104,7 @@ static void checkOpcode(final int opcode, final int type) { /** * Checks that the given value is a signed byte. - * + * * @param value * the value to be checked. * @param msg @@ -1116,7 +1119,7 @@ static void checkSignedByte(final int value, final String msg) { /** * Checks that the given value is a signed short. - * + * * @param value * the value to be checked. * @param msg @@ -1131,7 +1134,7 @@ static void checkSignedShort(final int value, final String msg) { /** * Checks that the given value is an unsigned short. - * + * * @param value * the value to be checked. * @param msg @@ -1147,7 +1150,7 @@ static void checkUnsignedShort(final int value, final String msg) { /** * Checks that the given value is an {@link Integer}, a{@link Float}, a * {@link Long}, a {@link Double} or a {@link String}. - * + * * @param cst * the value to be checked. */ @@ -1189,7 +1192,7 @@ void checkLDCConstant(final Object cst) { /** * Checks that the given string is a valid unqualified name. - * + * * @param version * the class version. * @param name @@ -1213,7 +1216,7 @@ static void checkUnqualifiedName(int version, final String name, /** * Checks that the given string is a valid Java identifier. - * + * * @param name * the string to be checked. * @param msg @@ -1225,7 +1228,7 @@ static void checkIdentifier(final String name, final String msg) { /** * Checks that the given substring is a valid Java identifier. - * + * * @param name * the string to be checked. * @param start @@ -1258,7 +1261,7 @@ static void checkIdentifier(final String name, final int start, /** * Checks that the given string is a valid Java identifier. - * + * * @param version * the class version. * @param name @@ -1301,7 +1304,7 @@ static void checkMethodIdentifier(int version, final String name, /** * Checks that the given string is a valid internal class name. - * + * * @param name * the string to be checked. * @param msg @@ -1321,7 +1324,7 @@ static void checkInternalName(final String name, final String msg) { /** * Checks that the given substring is a valid internal class name. - * + * * @param name * the string to be checked. * @param start @@ -1358,7 +1361,7 @@ static void checkInternalName(final String name, final int start, /** * Checks that the given string is a valid type descriptor. - * + * * @param desc * the string to be checked. * @param canBeVoid @@ -1373,7 +1376,7 @@ static void checkDesc(final String desc, final boolean canBeVoid) { /** * Checks that a the given substring is a valid type descriptor. - * + * * @param desc * the string to be checked. * @param start @@ -1437,7 +1440,7 @@ static int checkDesc(final String desc, final int start, /** * Checks that the given string is a valid method descriptor. - * + * * @param desc * the string to be checked. */ @@ -1468,7 +1471,7 @@ static void checkMethodDesc(final String desc) { /** * Checks that the given label is not null. This method can also check that * the label has been visited. - * + * * @param label * the label to be checked. * @param checkVisited @@ -1490,7 +1493,7 @@ void checkLabel(final Label label, final boolean checkVisited, /** * Checks that the given label is not a label used only for debug purposes. - * + * * @param label * the label to be checked. */ @@ -1510,7 +1513,7 @@ private static void checkNonDebugLabel(final Label label) { /** * Returns the Field object corresponding to the Label.status field. - * + * * @return the Field object corresponding to the Label.status field. */ private static Field getLabelStatusField() { @@ -1525,7 +1528,7 @@ private static Field getLabelStatusField() { /** * Returns the field of the Label class whose name is given. - * + * * @param name * a field name. * @return the field of the Label class whose name is given, or null. diff --git a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java index 54c9033..9226b4d 100644 --- a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java @@ -27,14 +27,14 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; -import scala.tools.asm.Opcodes; -import scala.tools.asm.signature.SignatureVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.signature.SignatureVisitor; /** * A {@link SignatureVisitor} that checks that its methods are properly used. - * + * * @author Eric Bruneton */ public class CheckSignatureAdapter extends SignatureVisitor { @@ -103,7 +103,7 @@ public class CheckSignatureAdapter extends SignatureVisitor { * Creates a new {@link CheckSignatureAdapter} object. Subclasses must * not use this constructor. Instead, they must use the * {@link #CheckSignatureAdapter(int, int, SignatureVisitor)} version. - * + * * @param type * the type of signature to be checked. See * {@link #CLASS_SIGNATURE}, {@link #METHOD_SIGNATURE} and @@ -118,7 +118,7 @@ public CheckSignatureAdapter(final int type, final SignatureVisitor sv) { /** * Creates a new {@link CheckSignatureAdapter} object. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. diff --git a/src/main/java/scala/tools/asm/util/Printer.java b/src/main/java/scala/tools/asm/util/Printer.java index 773f129..742aa3a 100644 --- a/src/main/java/scala/tools/asm/util/Printer.java +++ b/src/main/java/scala/tools/asm/util/Printer.java @@ -27,21 +27,21 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; -import scala.tools.asm.Attribute; -import scala.tools.asm.Handle; -import scala.tools.asm.Label; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Label; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; /** * An abstract converter from visit events to text. - * + * * @author Eric Bruneton */ public abstract class Printer { @@ -53,14 +53,14 @@ public abstract class Printer { /** * The names of the for operand parameter values of the - * {@link scala.tools.asm.MethodVisitor#visitIntInsn} method when + * {@link org.objectweb.asm.MethodVisitor#visitIntInsn} method when * opcode is NEWARRAY. */ public static final String[] TYPES; /** * The names of the tag field values for - * {@link scala.tools.asm.Handle}. + * {@link org.objectweb.asm.Handle}. */ public static final String[] HANDLE_TAG; @@ -142,6 +142,10 @@ public abstract class Printer { /** * Constructs a new {@link Printer}. + * + * @param api + * the ASM API version implemented by this printer. Must be one + * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. */ protected Printer(final int api) { this.api = api; @@ -150,67 +154,195 @@ protected Printer(final int api) { } /** - * Class header. See {@link scala.tools.asm.ClassVisitor#visit}. + * Class header. + * See {@link org.objectweb.asm.ClassVisitor#visit}. + * + * @param version + * the class version. + * @param access + * the class's access flags (see {@link Opcodes}). This parameter + * also indicates if the class is deprecated. + * @param name + * the internal name of the class (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * @param signature + * the signature of this class. May be null if the class + * is not a generic one, and does not extend or implement generic + * classes or interfaces. + * @param superName + * the internal of name of the super class (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * For interfaces, the super class is {@link Object}. May be + * null, but only for the {@link Object} class. + * @param interfaces + * the internal names of the class's interfaces (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * May be null. */ public abstract void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces); /** - * Class source. See {@link scala.tools.asm.ClassVisitor#visitSource}. + * Class source. + * See {@link org.objectweb.asm.ClassVisitor#visitSource}. + * + * @param source + * the name of the source file from which the class was compiled. + * May be null. + * @param debug + * additional debug information to compute the correspondance + * between source and compiled elements of the class. May be + * null. */ - public abstract void visitSource(final String file, final String debug); + public abstract void visitSource(final String source, final String debug); /** - * Class outer class. See - * {@link scala.tools.asm.ClassVisitor#visitOuterClass}. + * Class outer class. + * See {@link org.objectweb.asm.ClassVisitor#visitOuterClass}. + * + * Visits the enclosing class of the class. This method must be called only + * if the class has an enclosing class. + * + * @param owner + * internal name of the enclosing class of the class. + * @param name + * the name of the method that contains the class, or + * null if the class is not enclosed in a method of its + * enclosing class. + * @param desc + * the descriptor of the method that contains the class, or + * null if the class is not enclosed in a method of its + * enclosing class. */ public abstract void visitOuterClass(final String owner, final String name, final String desc); /** - * Class annotation. See - * {@link scala.tools.asm.ClassVisitor#visitAnnotation}. + * Class annotation. + * See {@link org.objectweb.asm.ClassVisitor#visitAnnotation}. + * + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public abstract Printer visitClassAnnotation(final String desc, final boolean visible); /** - * Class type annotation. See - * {@link scala.tools.asm.ClassVisitor#visitTypeAnnotation}. + * Class type annotation. + * See {@link org.objectweb.asm.ClassVisitor#visitTypeAnnotation}. + * + * @param typeRef + * a reference to the annotated type. The sort of this type + * reference must be + * {@link org.objectweb.asm.TypeReference#CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER}, + * {@link org.objectweb.asm.TypeReference#CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} + * or {@link org.objectweb.asm.TypeReference#CLASS_EXTENDS CLASS_EXTENDS}. + * See {@link org.objectweb.asm.TypeReference}. + * @param typePath + * the path to the annotated type argument, wildcard bound, array + * element type, or static inner type within 'typeRef'. May be + * null if the annotation targets 'typeRef' as a whole. + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public Printer visitClassTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Class attribute. See - * {@link scala.tools.asm.ClassVisitor#visitAttribute}. + * Class attribute. + * See {@link org.objectweb.asm.ClassVisitor#visitAttribute}. + * + * @param attr + * an attribute. */ public abstract void visitClassAttribute(final Attribute attr); /** - * Class inner name. See - * {@link scala.tools.asm.ClassVisitor#visitInnerClass}. + * Class inner name. + * See {@link org.objectweb.asm.ClassVisitor#visitInnerClass}. + * + * @param name + * the internal name of an inner class (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * @param outerName + * the internal name of the class to which the inner class + * belongs (see {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * May be null for not member classes. + * @param innerName + * the (simple) name of the inner class inside its enclosing + * class. May be null for anonymous inner classes. + * @param access + * the access flags of the inner class as originally declared in + * the enclosing class. */ public abstract void visitInnerClass(final String name, final String outerName, final String innerName, final int access); /** - * Class field. See {@link scala.tools.asm.ClassVisitor#visitField}. + * Class field. + * See {@link org.objectweb.asm.ClassVisitor#visitField}. + * + * @param access + * the field's access flags (see {@link Opcodes}). This parameter + * also indicates if the field is synthetic and/or deprecated. + * @param name + * the field's name. + * @param desc + * the field's descriptor (see {@link org.objectweb.asm.Type Type}). + * @param signature + * the field's signature. May be null if the field's + * type does not use generic types. + * @param value + * the field's initial value. This parameter, which may be + * null if the field does not have an initial value, + * must be an {@link Integer}, a {@link Float}, a {@link Long}, a + * {@link Double} or a {@link String} (for int, + * float, long or String fields + * respectively). This parameter is only used for static + * fields. Its value is ignored for non static fields, which + * must be initialized through bytecode instructions in + * constructors or methods. + * @return the printer */ public abstract Printer visitField(final int access, final String name, final String desc, final String signature, final Object value); /** - * Class method. See {@link scala.tools.asm.ClassVisitor#visitMethod}. + * Class method. + * See {@link org.objectweb.asm.ClassVisitor#visitMethod}. + * + * @param access + * the method's access flags (see {@link Opcodes}). This + * parameter also indicates if the method is synthetic and/or + * deprecated. + * @param name + * the method's name. + * @param desc + * the method's descriptor (see {@link org.objectweb.asm.Type Type}). + * @param signature + * the method's signature. May be null if the method + * parameters, return type and exceptions do not use generic + * types. + * @param exceptions + * the internal names of the method's exception classes (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). May be + * null. + * @return the printer */ public abstract Printer visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions); /** - * Class end. See {@link scala.tools.asm.ClassVisitor#visitEnd}. + * Class end. See {@link org.objectweb.asm.ClassVisitor#visitEnd}. */ public abstract void visitClassEnd(); @@ -219,31 +351,69 @@ public abstract Printer visitMethod(final int access, final String name, // ------------------------------------------------------------------------ /** - * Annotation value. See {@link scala.tools.asm.AnnotationVisitor#visit}. + * Annotation value. + * See {@link org.objectweb.asm.AnnotationVisitor#visit}. + * + * @param name + * the value name. + * @param value + * the actual value, whose type must be {@link Byte}, + * {@link Boolean}, {@link Character}, {@link Short}, + * {@link Integer} , {@link Long}, {@link Float}, {@link Double}, + * {@link String} or {@link org.objectweb.asm.Type} + * or OBJECT or ARRAY sort. + * This value can also be an array of byte, boolean, short, char, int, + * long, float or double values (this is equivalent to using + * {@link #visitArray visitArray} and visiting each array element + * in turn, but is more convenient). */ public abstract void visit(final String name, final Object value); /** - * Annotation enum value. See - * {@link scala.tools.asm.AnnotationVisitor#visitEnum}. + * Annotation enum value. + * See {@link org.objectweb.asm.AnnotationVisitor#visitEnum}. + * + * Visits an enumeration value of the annotation. + * + * @param name + * the value name. + * @param desc + * the class descriptor of the enumeration class. + * @param value + * the actual enumeration value. */ public abstract void visitEnum(final String name, final String desc, final String value); /** - * Nested annotation value. See - * {@link scala.tools.asm.AnnotationVisitor#visitAnnotation}. + * Nested annotation value. + * See {@link org.objectweb.asm.AnnotationVisitor#visitAnnotation}. + * + * @param name + * the value name. + * @param desc + * the class descriptor of the nested annotation class. + * @return the printer */ public abstract Printer visitAnnotation(final String name, final String desc); /** - * Annotation array value. See - * {@link scala.tools.asm.AnnotationVisitor#visitArray}. + * Annotation array value. + * See {@link org.objectweb.asm.AnnotationVisitor#visitArray}. + * + * Visits an array value of the annotation. Note that arrays of primitive + * types (such as byte, boolean, short, char, int, long, float or double) + * can be passed as value to {@link #visit visit}. This is what + * {@link org.objectweb.asm.ClassReader} does. + * + * @param name + * the value name. + * @return the printer */ public abstract Printer visitArray(final String name); /** - * Annotation end. See {@link scala.tools.asm.AnnotationVisitor#visitEnd}. + * Annotation end. See {@link org.objectweb.asm.AnnotationVisitor#visitEnd}. */ public abstract void visitAnnotationEnd(); @@ -252,29 +422,53 @@ public abstract void visitEnum(final String name, final String desc, // ------------------------------------------------------------------------ /** - * Field annotation. See - * {@link scala.tools.asm.FieldVisitor#visitAnnotation}. + * Field annotation. + * See {@link org.objectweb.asm.FieldVisitor#visitAnnotation}. + * + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public abstract Printer visitFieldAnnotation(final String desc, final boolean visible); /** - * Field type annotation. See - * {@link scala.tools.asm.FieldVisitor#visitTypeAnnotation}. + * Field type annotation. + * See {@link org.objectweb.asm.FieldVisitor#visitTypeAnnotation}. + * + * @param typeRef + * a reference to the annotated type. The sort of this type + * reference must be {@link org.objectweb.asm.TypeReference#FIELD FIELD}. + * See {@link org.objectweb.asm.TypeReference}. + * @param typePath + * the path to the annotated type argument, wildcard bound, array + * element type, or static inner type within 'typeRef'. May be + * null if the annotation targets 'typeRef' as a whole. + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public Printer visitFieldTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Field attribute. See - * {@link scala.tools.asm.FieldVisitor#visitAttribute}. + * Field attribute. + * See {@link org.objectweb.asm.FieldVisitor#visitAttribute}. + * + * @param attr + * an attribute. */ public abstract void visitFieldAttribute(final Attribute attr); /** - * Field end. See {@link scala.tools.asm.FieldVisitor#visitEnd}. + * Field end. + * See {@link org.objectweb.asm.FieldVisitor#visitEnd}. */ public abstract void visitFieldEnd(); @@ -283,94 +477,284 @@ public Printer visitFieldTypeAnnotation(final int typeRef, // ------------------------------------------------------------------------ /** - * Method parameter. See - * {@link scala.tools.asm.MethodVisitor#visitParameter(String, int)}. + * Method parameter. + * See {@link org.objectweb.asm.MethodVisitor#visitParameter(String, int)}. + * + * @param name + * parameter name or null if none is provided. + * @param access + * the parameter's access flags, only ACC_FINAL, + * ACC_SYNTHETIC or/and ACC_MANDATED are + * allowed (see {@link Opcodes}). */ public void visitParameter(String name, int access) { - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Method default annotation. See - * {@link scala.tools.asm.MethodVisitor#visitAnnotationDefault}. + * Method default annotation. + * See {@link org.objectweb.asm.MethodVisitor#visitAnnotationDefault}. + * + * @return the printer */ public abstract Printer visitAnnotationDefault(); /** - * Method annotation. See - * {@link scala.tools.asm.MethodVisitor#visitAnnotation}. + * Method annotation. + * See {@link org.objectweb.asm.MethodVisitor#visitAnnotation}. + * + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public abstract Printer visitMethodAnnotation(final String desc, final boolean visible); /** - * Method type annotation. See - * {@link scala.tools.asm.MethodVisitor#visitTypeAnnotation}. + * Method type annotation. + * See {@link org.objectweb.asm.MethodVisitor#visitTypeAnnotation}. + * + * @param typeRef + * a reference to the annotated type. The sort of this type + * reference must be {@link org.objectweb.asm.TypeReference#FIELD FIELD}. + * See {@link org.objectweb.asm.TypeReference}. + * @param typePath + * the path to the annotated type argument, wildcard bound, array + * element type, or static inner type within 'typeRef'. May be + * null if the annotation targets 'typeRef' as a whole. + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public Printer visitMethodTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Method parameter annotation. See - * {@link scala.tools.asm.MethodVisitor#visitParameterAnnotation}. + * Method parameter annotation. + * See {@link org.objectweb.asm.MethodVisitor#visitParameterAnnotation}. + * + * @param parameter + * the parameter index. + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public abstract Printer visitParameterAnnotation(final int parameter, final String desc, final boolean visible); /** - * Method attribute. See - * {@link scala.tools.asm.MethodVisitor#visitAttribute}. + * Method attribute. + * See {@link org.objectweb.asm.MethodVisitor#visitAttribute}. + * + * @param attr + * an attribute. */ public abstract void visitMethodAttribute(final Attribute attr); /** - * Method start. See {@link scala.tools.asm.MethodVisitor#visitCode}. + * Method start. + * See {@link org.objectweb.asm.MethodVisitor#visitCode}. */ public abstract void visitCode(); /** - * Method stack frame. See - * {@link scala.tools.asm.MethodVisitor#visitFrame}. + * Method stack frame. + * See {@link org.objectweb.asm.MethodVisitor#visitFrame}. + * + * Visits the current state of the local variables and operand stack + * elements. This method must(*) be called just before any + * instruction i that follows an unconditional branch instruction + * such as GOTO or THROW, that is the target of a jump instruction, or that + * starts an exception handler block. The visited types must describe the + * values of the local variables and of the operand stack elements just + * before i is executed.
+ *
+ * (*) this is mandatory only for classes whose version is greater than or + * equal to {@link Opcodes#V1_6 V1_6}.
+ *
+ * The frames of a method must be given either in expanded form, or in + * compressed form (all frames must use the same format, i.e. you must not + * mix expanded and compressed frames within a single method): + *

    + *
  • In expanded form, all frames must have the F_NEW type.
  • + *
  • In compressed form, frames are basically "deltas" from the state of + * the previous frame: + *
      + *
    • {@link Opcodes#F_SAME} representing frame with exactly the same + * locals as the previous frame and with the empty stack.
    • + *
    • {@link Opcodes#F_SAME1} representing frame with exactly the same + * locals as the previous frame and with single value on the stack ( + * nStack is 1 and stack[0] contains value for the + * type of the stack item).
    • + *
    • {@link Opcodes#F_APPEND} representing frame with current locals are + * the same as the locals in the previous frame, except that additional + * locals are defined (nLocal is 1, 2 or 3 and + * local elements contains values representing added types).
    • + *
    • {@link Opcodes#F_CHOP} representing frame with current locals are the + * same as the locals in the previous frame, except that the last 1-3 locals + * are absent and with the empty stack (nLocals is 1, 2 or 3).
    • + *
    • {@link Opcodes#F_FULL} representing complete frame data.
    • + *
    + *
  • + *
+ *
+ * In both cases the first frame, corresponding to the method's parameters + * and access flags, is implicit and must not be visited. Also, it is + * illegal to visit two or more frames for the same code location (i.e., at + * least one instruction must be visited between two calls to visitFrame). + * + * @param type + * the type of this stack map frame. Must be + * {@link Opcodes#F_NEW} for expanded frames, or + * {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND}, + * {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or + * {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for + * compressed frames. + * @param nLocal + * the number of local variables in the visited frame. + * @param local + * the local variable types in this frame. This array must not be + * modified. Primitive types are represented by + * {@link Opcodes#TOP}, {@link Opcodes#INTEGER}, + * {@link Opcodes#FLOAT}, {@link Opcodes#LONG}, + * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or + * {@link Opcodes#UNINITIALIZED_THIS} (long and double are + * represented by a single element). Reference types are + * represented by String objects (representing internal names), + * and uninitialized types by Label objects (this label + * designates the NEW instruction that created this uninitialized + * value). + * @param nStack + * the number of operand stack elements in the visited frame. + * @param stack + * the operand stack types in this frame. This array must not be + * modified. Its content has the same format as the "local" + * array. + * @throws IllegalStateException + * if a frame is visited just after another one, without any + * instruction between the two (unless this frame is a + * Opcodes#F_SAME frame, in which case it is silently ignored). */ public abstract void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack, final Object[] stack); /** - * Method instruction. See {@link scala.tools.asm.MethodVisitor#visitInsn} - * . + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitInsn} + * + * @param opcode + * the opcode of the instruction to be visited. This opcode is + * either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, + * ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, + * FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, + * LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, + * IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, + * SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, + * DUP2_X2, SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, + * IMUL, LMUL, FMUL, DMUL, IDIV, LDIV, FDIV, DDIV, IREM, LREM, + * FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR, + * IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D, + * L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B, I2C, I2S, + * LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN, + * DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER, + * or MONITOREXIT. */ public abstract void visitInsn(final int opcode); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitIntInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitIntInsn}. + * + * @param opcode + * the opcode of the instruction to be visited. This opcode is + * either BIPUSH, SIPUSH or NEWARRAY. + * @param operand + * the operand of the instruction to be visited.
+ * When opcode is BIPUSH, operand value should be between + * Byte.MIN_VALUE and Byte.MAX_VALUE.
+ * When opcode is SIPUSH, operand value should be between + * Short.MIN_VALUE and Short.MAX_VALUE.
+ * When opcode is NEWARRAY, operand value should be one of + * {@link Opcodes#T_BOOLEAN}, {@link Opcodes#T_CHAR}, + * {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE}, + * {@link Opcodes#T_BYTE}, {@link Opcodes#T_SHORT}, + * {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}. */ public abstract void visitIntInsn(final int opcode, final int operand); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitVarInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitVarInsn}. + * + * @param opcode + * the opcode of the local variable instruction to be visited. + * This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, + * ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET. + * @param var + * the operand of the instruction to be visited. This operand is + * the index of a local variable. */ public abstract void visitVarInsn(final int opcode, final int var); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitTypeInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitTypeInsn}. + * + /** + * Visits a type instruction. A type instruction is an instruction that + * takes the internal name of a class as parameter. + * + * @param opcode + * the opcode of the type instruction to be visited. This opcode + * is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF. + * @param type + * the operand of the instruction to be visited. This operand + * must be the internal name of an object or array class (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). */ public abstract void visitTypeInsn(final int opcode, final String type); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitFieldInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitFieldInsn}. + * + * @param opcode + * the opcode of the type instruction to be visited. This opcode + * is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. + * @param owner + * the internal name of the field's owner class (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * @param name + * the field's name. + * @param desc + * the field's descriptor (see {@link org.objectweb.asm.Type Type}). */ public abstract void visitFieldInsn(final int opcode, final String owner, final String name, final String desc); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitMethodInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitMethodInsn}. + * + * @param opcode + * the opcode of the type instruction to be visited. This opcode + * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or + * INVOKEINTERFACE. + * @param owner + * the internal name of the method's owner class (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * @param name + * the method's name. + * @param desc + * the method's descriptor (see {@link org.objectweb.asm.Type Type}). */ @Deprecated public void visitMethodInsn(final int opcode, final String owner, @@ -380,12 +764,26 @@ public void visitMethodInsn(final int opcode, final String owner, visitMethodInsn(opcode, owner, name, desc, itf); return; } - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitMethodInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitMethodInsn}. + * + * @param opcode + * the opcode of the type instruction to be visited. This opcode + * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or + * INVOKEINTERFACE. + * @param owner + * the internal name of the method's owner class (see + * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * @param name + * the method's name. + * @param desc + * the method's descriptor (see {@link org.objectweb.asm.Type Type}). + * @param itf + * if the method's owner class is an interface. */ public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, final boolean itf) { @@ -397,123 +795,335 @@ public void visitMethodInsn(final int opcode, final String owner, visitMethodInsn(opcode, owner, name, desc); return; } - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitInvokeDynamicInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitInvokeDynamicInsn}. + * + * Visits an invokedynamic instruction. + * + * @param name + * the method's name. + * @param desc + * the method's descriptor (see {@link org.objectweb.asm.Type Type}). + * @param bsm + * the bootstrap method. + * @param bsmArgs + * the bootstrap method constant arguments. Each argument must be + * an {@link Integer}, {@link Float}, {@link Long}, + * {@link Double}, {@link String}, {@link org.objectweb.asm.Type} or {@link Handle} + * value. This method is allowed to modify the content of the + * array so a caller should expect that this array may change. */ public abstract void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitJumpInsn}. + * Method jump instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitJumpInsn}. + * + * @param opcode + * the opcode of the type instruction to be visited. This opcode + * is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, + * IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, + * IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL. + * @param label + * the operand of the instruction to be visited. This operand is + * a label that designates the instruction to which the jump + * instruction may jump. */ public abstract void visitJumpInsn(final int opcode, final Label label); /** - * Method label. See {@link scala.tools.asm.MethodVisitor#visitLabel}. + * Method label. + * See {@link org.objectweb.asm.MethodVisitor#visitLabel}. + * + * @param label + * a {@link Label Label} object. */ public abstract void visitLabel(final Label label); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitLdcInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitLdcInsn}. + * + * Visits a LDC instruction. Note that new constant types may be added in + * future versions of the Java Virtual Machine. To easily detect new + * constant types, implementations of this method should check for + * unexpected constant types, like this: + * + *
+     * if (cst instanceof Integer) {
+     *     // ...
+     * } else if (cst instanceof Float) {
+     *     // ...
+     * } else if (cst instanceof Long) {
+     *     // ...
+     * } else if (cst instanceof Double) {
+     *     // ...
+     * } else if (cst instanceof String) {
+     *     // ...
+     * } else if (cst instanceof Type) {
+     *     int sort = ((Type) cst).getSort();
+     *     if (sort == Type.OBJECT) {
+     *         // ...
+     *     } else if (sort == Type.ARRAY) {
+     *         // ...
+     *     } else if (sort == Type.METHOD) {
+     *         // ...
+     *     } else {
+     *         // throw an exception
+     *     }
+     * } else if (cst instanceof Handle) {
+     *     // ...
+     * } else {
+     *     // throw an exception
+     * }
+     * 
+ * + * @param cst + * the constant to be loaded on the stack. This parameter must be + * a non null {@link Integer}, a {@link Float}, a {@link Long}, a + * {@link Double}, a {@link String}, a {@link org.objectweb.asm.Type} + * of OBJECT or ARRAY sort for .class constants, for classes whose + * version is 49.0, a {@link org.objectweb.asm.Type} of METHOD sort or a + * {@link Handle} for MethodType and MethodHandle constants, for + * classes whose version is 51.0. */ public abstract void visitLdcInsn(final Object cst); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitIincInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitIincInsn}. + * + * @param var + * index of the local variable to be incremented. + * @param increment + * amount to increment the local variable by. */ public abstract void visitIincInsn(final int var, final int increment); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitTableSwitchInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitTableSwitchInsn}. + * + * @param min + * the minimum key value. + * @param max + * the maximum key value. + * @param dflt + * beginning of the default handler block. + * @param labels + * beginnings of the handler blocks. labels[i] is the + * beginning of the handler block for the min + i key. */ public abstract void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label... labels); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitLookupSwitchInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitLookupSwitchInsn}. + * + * @param dflt + * beginning of the default handler block. + * @param keys + * the values of the keys. + * @param labels + * beginnings of the handler blocks. labels[i] is the + * beginning of the handler block for the keys[i] key. */ public abstract void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels); /** - * Method instruction. See - * {@link scala.tools.asm.MethodVisitor#visitMultiANewArrayInsn}. + * Method instruction. + * See {@link org.objectweb.asm.MethodVisitor#visitMultiANewArrayInsn}. + * + * @param desc + * an array type descriptor (see {@link org.objectweb.asm.Type Type}). + * @param dims + * number of dimensions of the array to allocate. */ public abstract void visitMultiANewArrayInsn(final String desc, final int dims); /** - * Instruction type annotation. See - * {@link scala.tools.asm.MethodVisitor#visitInsnAnnotation}. + * Instruction type annotation. + * See {@link org.objectweb.asm.MethodVisitor#visitInsnAnnotation}. + * + * @param typeRef + * a reference to the annotated type. The sort of this type + * reference must be {@link org.objectweb.asm.TypeReference#INSTANCEOF INSTANCEOF}, + * {@link org.objectweb.asm.TypeReference#NEW NEW}, + * {@link org.objectweb.asm.TypeReference#CONSTRUCTOR_REFERENCE CONSTRUCTOR_REFERENCE}, + * {@link org.objectweb.asm.TypeReference#METHOD_REFERENCE METHOD_REFERENCE}, + * {@link org.objectweb.asm.TypeReference#CAST CAST}, + * {@link org.objectweb.asm.TypeReference#CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}, + * {@link org.objectweb.asm.TypeReference#METHOD_INVOCATION_TYPE_ARGUMENT METHOD_INVOCATION_TYPE_ARGUMENT}, + * {@link org.objectweb.asm.TypeReference#CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, + * or {@link org.objectweb.asm.TypeReference#METHOD_REFERENCE_TYPE_ARGUMENT METHOD_REFERENCE_TYPE_ARGUMENT}. + * See {@link org.objectweb.asm.TypeReference}. + * @param typePath + * the path to the annotated type argument, wildcard bound, array + * element type, or static inner type within 'typeRef'. May be + * null if the annotation targets 'typeRef' as a whole. + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public Printer visitInsnAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Method exception handler. See - * {@link scala.tools.asm.MethodVisitor#visitTryCatchBlock}. + * Method exception handler. + * See {@link org.objectweb.asm.MethodVisitor#visitTryCatchBlock}. + * + * @param start + * beginning of the exception handler's scope (inclusive). + * @param end + * end of the exception handler's scope (exclusive). + * @param handler + * beginning of the exception handler's code. + * @param type + * internal name of the type of exceptions handled by the + * handler, or null to catch any exceptions (for + * "finally" blocks). + * @throws IllegalArgumentException + * if one of the labels has already been visited by this visitor + * (by the {@link #visitLabel visitLabel} method). */ public abstract void visitTryCatchBlock(final Label start, final Label end, final Label handler, final String type); /** - * Try catch block type annotation. See - * {@link scala.tools.asm.MethodVisitor#visitTryCatchAnnotation}. + * Try catch block type annotation. + * See {@link org.objectweb.asm.MethodVisitor#visitTryCatchAnnotation}. + * + * @param typeRef + * a reference to the annotated type. The sort of this type + * reference must be {@link org.objectweb.asm.TypeReference#EXCEPTION_PARAMETER + * EXCEPTION_PARAMETER}. + * See {@link org.objectweb.asm.TypeReference}. + * @param typePath + * the path to the annotated type argument, wildcard bound, array + * element type, or static inner type within 'typeRef'. May be + * null if the annotation targets 'typeRef' as a whole. + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public Printer visitTryCatchAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Method debug info. See - * {@link scala.tools.asm.MethodVisitor#visitLocalVariable}. + * Method debug info. + * See {@link org.objectweb.asm.MethodVisitor#visitLocalVariable}. + * + * @param name + * the name of a local variable. + * @param desc + * the type descriptor of this local variable. + * @param signature + * the type signature of this local variable. May be + * null if the local variable type does not use generic + * types. + * @param start + * the first instruction corresponding to the scope of this local + * variable (inclusive). + * @param end + * the last instruction corresponding to the scope of this local + * variable (exclusive). + * @param index + * the local variable's index. + * @throws IllegalArgumentException + * if one of the labels has not already been visited by this + * visitor (by the {@link #visitLabel visitLabel} method). */ public abstract void visitLocalVariable(final String name, final String desc, final String signature, final Label start, final Label end, final int index); /** - * Local variable type annotation. See - * {@link scala.tools.asm.MethodVisitor#visitTryCatchAnnotation}. + * Local variable type annotation. + * See {@link org.objectweb.asm.MethodVisitor#visitTryCatchAnnotation}. + * + * @param typeRef + * a reference to the annotated type. The sort of this type + * reference must be {@link org.objectweb.asm.TypeReference#LOCAL_VARIABLE + * LOCAL_VARIABLE} or {@link org.objectweb.asm.TypeReference#RESOURCE_VARIABLE + * RESOURCE_VARIABLE}. + * See {@link org.objectweb.asm.TypeReference}. + * @param typePath + * the path to the annotated type argument, wildcard bound, array + * element type, or static inner type within 'typeRef'. May be + * null if the annotation targets 'typeRef' as a whole. + * @param start + * the fist instructions corresponding to the continuous ranges + * that make the scope of this local variable (inclusive). + * @param end + * the last instructions corresponding to the continuous ranges + * that make the scope of this local variable (exclusive). This + * array must have the same size as the 'start' array. + * @param index + * the local variable's index in each range. This array must have + * the same size as the 'start' array. + * @param desc + * the class descriptor of the annotation class. + * @param visible + * true if the annotation is visible at runtime. + * @return the printer */ public Printer visitLocalVariableAnnotation(final int typeRef, final TypePath typePath, final Label[] start, final Label[] end, final int[] index, final String desc, final boolean visible) { - throw new RuntimeException("Must be overridden"); + throw new RuntimeException("Must be overriden"); } /** - * Method debug info. See - * {@link scala.tools.asm.MethodVisitor#visitLineNumber}. + * Method debug info. + * See {@link org.objectweb.asm.MethodVisitor#visitLineNumber}. + * + * @param line + * a line number. This number refers to the source file from + * which the class was compiled. + * @param start + * the first instruction corresponding to this line number. + * @throws IllegalArgumentException + * if start has not already been visited by this + * visitor (by the {@link #visitLabel visitLabel} method). */ public abstract void visitLineNumber(final int line, final Label start); /** - * Method max stack and max locals. See - * {@link scala.tools.asm.MethodVisitor#visitMaxs}. + * Method max stack and max locals. + * See {@link org.objectweb.asm.MethodVisitor#visitMaxs}. + * + * @param maxStack + * maximum stack size of the method. + * @param maxLocals + * maximum number of local variables for the method. */ public abstract void visitMaxs(final int maxStack, final int maxLocals); /** - * Method end. See {@link scala.tools.asm.MethodVisitor#visitEnd}. + * Method end. + * See {@link org.objectweb.asm.MethodVisitor#visitEnd}. */ public abstract void visitMethodEnd(); /** * Returns the text constructed by this visitor. - * + * * @return the text constructed by this visitor. */ public List getText() { @@ -522,7 +1132,7 @@ public List getText() { /** * Prints the text constructed by this visitor. - * + * * @param pw * the print writer to be used. */ @@ -532,7 +1142,7 @@ public void print(final PrintWriter pw) { /** * Appends a quoted string to a given buffer. - * + * * @param buf * the buffer where the string must be added. * @param s @@ -569,7 +1179,7 @@ public static void appendString(final StringBuffer buf, final String s) { /** * Prints the given string tree. - * + * * @param pw * the writer to be used to print the tree. * @param l @@ -586,4 +1196,4 @@ static void printList(final PrintWriter pw, final List l) { } } } -} +} \ No newline at end of file diff --git a/src/main/java/scala/tools/asm/util/Textifiable.java b/src/main/java/scala/tools/asm/util/Textifiable.java index 85e051e..aad97ba 100644 --- a/src/main/java/scala/tools/asm/util/Textifiable.java +++ b/src/main/java/scala/tools/asm/util/Textifiable.java @@ -27,26 +27,26 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.util.Map; -import scala.tools.asm.Label; +import org.objectweb.asm.Label; /** - * An {@link scala.tools.asm.Attribute Attribute} that can print a readable + * An {@link org.objectweb.asm.Attribute Attribute} that can print a readable * representation of itself. - * + * * Implementations should construct readable output from an attribute data * structure. Such representation could be used in unit test assertions. - * + * * @author Eugene Kuleshov */ public interface Textifiable { /** * Build a human readable representation of this attribute. - * + * * @param buf * a buffer used for printing Java code. * @param labelNames diff --git a/src/main/java/scala/tools/asm/util/Textifier.java b/src/main/java/scala/tools/asm/util/Textifier.java index 8c71024..895c7e2 100644 --- a/src/main/java/scala/tools/asm/util/Textifier.java +++ b/src/main/java/scala/tools/asm/util/Textifier.java @@ -27,22 +27,22 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.io.FileInputStream; import java.io.PrintWriter; import java.util.HashMap; import java.util.Map; -import scala.tools.asm.Attribute; -import scala.tools.asm.ClassReader; -import scala.tools.asm.Handle; -import scala.tools.asm.Label; -import scala.tools.asm.Opcodes; -import scala.tools.asm.Type; -import scala.tools.asm.TypePath; -import scala.tools.asm.TypeReference; -import scala.tools.asm.signature.SignatureReader; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Label; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; +import org.objectweb.asm.TypePath; +import org.objectweb.asm.TypeReference; +import org.objectweb.asm.signature.SignatureReader; /** * A {@link Printer} that prints a disassembled view of the classes it visits. diff --git a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java index 7a9dbfe..84d6196 100644 --- a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java @@ -27,15 +27,15 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Opcodes; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Opcodes; /** * An {@link AnnotationVisitor} that prints the annotations it visits with a * {@link Printer}. - * + * * @author Eric Bruneton */ public final class TraceAnnotationVisitor extends AnnotationVisitor { diff --git a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java index 842d286..3ca5978 100644 --- a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java @@ -27,17 +27,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; import java.io.PrintWriter; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.ClassVisitor; -import scala.tools.asm.FieldVisitor; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; /** * A {@link ClassVisitor} that prints the classes it visits with a @@ -48,36 +48,36 @@ * The trace printed when visiting the Hello class is the following: *

*

- * + * *
  * // class version 49.0 (49) // access flags 0x21 public class Hello {
- *
+ * 
  * // compiled from: Hello.java
- *
+ * 
  * // access flags 0x1 public <init> ()V ALOAD 0 INVOKESPECIAL
  * java/lang/Object <init> ()V RETURN MAXSTACK = 1 MAXLOCALS = 1
- *
+ * 
  * // access flags 0x9 public static main ([Ljava/lang/String;)V GETSTATIC
  * java/lang/System out Ljava/io/PrintStream; LDC "hello"
  * INVOKEVIRTUAL java/io/PrintStream println (Ljava/lang/String;)V RETURN
  * MAXSTACK = 2 MAXLOCALS = 1 }
  * 
- * + * *
where Hello is defined by: *

*

- * + * *
  * public class Hello {
- *
+ * 
  *     public static void main(String[] args) {
  *         System.out.println("hello");
  *     }
  * }
  * 
- * + * *
- * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -95,7 +95,7 @@ public final class TraceClassVisitor extends ClassVisitor { /** * Constructs a new {@link TraceClassVisitor}. - * + * * @param pw * the print writer to be used to print the class. */ @@ -105,7 +105,7 @@ public TraceClassVisitor(final PrintWriter pw) { /** * Constructs a new {@link TraceClassVisitor}. - * + * * @param cv * the {@link ClassVisitor} to which this visitor delegates * calls. May be null. @@ -118,7 +118,7 @@ public TraceClassVisitor(final ClassVisitor cv, final PrintWriter pw) { /** * Constructs a new {@link TraceClassVisitor}. - * + * * @param cv * the {@link ClassVisitor} to which this visitor delegates * calls. May be null. diff --git a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java index 1d0743a..dbb3be0 100644 --- a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java @@ -27,18 +27,18 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.FieldVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; /** * A {@link FieldVisitor} that prints the fields it visits with a * {@link Printer}. - * + * * @author Eric Bruneton */ public final class TraceFieldVisitor extends FieldVisitor { diff --git a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java index db5f051..5f72ac6 100644 --- a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java @@ -27,20 +27,20 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; -import scala.tools.asm.AnnotationVisitor; -import scala.tools.asm.Attribute; -import scala.tools.asm.Handle; -import scala.tools.asm.Label; -import scala.tools.asm.MethodVisitor; -import scala.tools.asm.Opcodes; -import scala.tools.asm.TypePath; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.Handle; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.TypePath; /** * A {@link MethodVisitor} that prints the methods it visits with a * {@link Printer}. - * + * * @author Eric Bruneton */ public final class TraceMethodVisitor extends MethodVisitor { diff --git a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java index f99ec2b..20d426e 100644 --- a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java @@ -27,21 +27,21 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package scala.tools.asm.util; +package org.objectweb.asm.util; -import scala.tools.asm.Opcodes; -import scala.tools.asm.signature.SignatureVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.signature.SignatureVisitor; /** * A {@link SignatureVisitor} that prints a disassembled view of the signature * it visits. - * + * * @author Eugene Kuleshov * @author Eric Bruneton */ public final class TraceSignatureVisitor extends SignatureVisitor { - private final StringBuffer declaration; + private final StringBuilder declaration; private boolean isInterface; @@ -53,9 +53,9 @@ public final class TraceSignatureVisitor extends SignatureVisitor { private boolean seenInterface; - private StringBuffer returnType; + private StringBuilder returnType; - private StringBuffer exceptions; + private StringBuilder exceptions; /** * Stack used to keep track of class types that have arguments. Each element @@ -77,10 +77,10 @@ public final class TraceSignatureVisitor extends SignatureVisitor { public TraceSignatureVisitor(final int access) { super(Opcodes.ASM5); isInterface = (access & Opcodes.ACC_INTERFACE) != 0; - this.declaration = new StringBuffer(); + this.declaration = new StringBuilder(); } - private TraceSignatureVisitor(final StringBuffer buf) { + private TraceSignatureVisitor(final StringBuilder buf) { super(Opcodes.ASM5); this.declaration = buf; } @@ -146,14 +146,14 @@ public SignatureVisitor visitReturnType() { declaration.append('('); } declaration.append(')'); - returnType = new StringBuffer(); + returnType = new StringBuilder(); return new TraceSignatureVisitor(returnType); } @Override public SignatureVisitor visitExceptionType() { if (exceptions == null) { - exceptions = new StringBuffer(); + exceptions = new StringBuilder(); } else { exceptions.append(", "); } From c45dc6af6eee5577599742086f7bae159318ae02 Mon Sep 17 00:00:00 2001 From: Carsten Varming Date: Mon, 18 Jul 2016 12:29:07 -0400 Subject: [PATCH 02/17] update package clauses --- src/main/java/scala/tools/asm/AnnotationVisitor.java | 2 +- src/main/java/scala/tools/asm/AnnotationWriter.java | 2 +- src/main/java/scala/tools/asm/Attribute.java | 2 +- src/main/java/scala/tools/asm/ByteVector.java | 2 +- src/main/java/scala/tools/asm/ClassReader.java | 2 +- src/main/java/scala/tools/asm/ClassVisitor.java | 2 +- src/main/java/scala/tools/asm/ClassWriter.java | 2 +- src/main/java/scala/tools/asm/Context.java | 2 +- src/main/java/scala/tools/asm/Edge.java | 2 +- src/main/java/scala/tools/asm/FieldVisitor.java | 2 +- src/main/java/scala/tools/asm/FieldWriter.java | 2 +- src/main/java/scala/tools/asm/Frame.java | 2 +- src/main/java/scala/tools/asm/Handle.java | 2 +- src/main/java/scala/tools/asm/Handler.java | 2 +- src/main/java/scala/tools/asm/Item.java | 2 +- src/main/java/scala/tools/asm/Label.java | 2 +- src/main/java/scala/tools/asm/MethodVisitor.java | 2 +- src/main/java/scala/tools/asm/MethodWriter.java | 2 +- src/main/java/scala/tools/asm/Opcodes.java | 2 +- src/main/java/scala/tools/asm/Type.java | 2 +- src/main/java/scala/tools/asm/TypePath.java | 2 +- src/main/java/scala/tools/asm/TypeReference.java | 2 +- src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java | 2 +- src/main/java/scala/tools/asm/signature/SignatureReader.java | 2 +- src/main/java/scala/tools/asm/signature/SignatureVisitor.java | 2 +- src/main/java/scala/tools/asm/signature/SignatureWriter.java | 2 +- src/main/java/scala/tools/asm/tree/AbstractInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/AnnotationNode.java | 2 +- src/main/java/scala/tools/asm/tree/ClassNode.java | 2 +- src/main/java/scala/tools/asm/tree/FieldInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/FieldNode.java | 2 +- src/main/java/scala/tools/asm/tree/FrameNode.java | 2 +- src/main/java/scala/tools/asm/tree/IincInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/InnerClassNode.java | 2 +- src/main/java/scala/tools/asm/tree/InsnList.java | 2 +- src/main/java/scala/tools/asm/tree/InsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/IntInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/JumpInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/LabelNode.java | 2 +- src/main/java/scala/tools/asm/tree/LdcInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/LineNumberNode.java | 2 +- .../java/scala/tools/asm/tree/LocalVariableAnnotationNode.java | 2 +- src/main/java/scala/tools/asm/tree/LocalVariableNode.java | 2 +- src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/MethodInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/MethodNode.java | 2 +- src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/ParameterNode.java | 2 +- src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java | 2 +- src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java | 2 +- src/main/java/scala/tools/asm/tree/TypeInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/VarInsnNode.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/Analyzer.java | 2 +- .../java/scala/tools/asm/tree/analysis/AnalyzerException.java | 2 +- .../java/scala/tools/asm/tree/analysis/BasicInterpreter.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/BasicValue.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/Frame.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/Interpreter.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/SmallSet.java | 2 +- .../java/scala/tools/asm/tree/analysis/SourceInterpreter.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/SourceValue.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/Subroutine.java | 2 +- src/main/java/scala/tools/asm/tree/analysis/Value.java | 2 +- src/main/java/scala/tools/asm/util/ASMifiable.java | 2 +- src/main/java/scala/tools/asm/util/ASMifier.java | 2 +- src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java | 2 +- src/main/java/scala/tools/asm/util/CheckClassAdapter.java | 2 +- src/main/java/scala/tools/asm/util/CheckFieldAdapter.java | 2 +- src/main/java/scala/tools/asm/util/CheckMethodAdapter.java | 2 +- src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java | 2 +- src/main/java/scala/tools/asm/util/Printer.java | 2 +- src/main/java/scala/tools/asm/util/Textifiable.java | 2 +- src/main/java/scala/tools/asm/util/Textifier.java | 2 +- src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java | 2 +- src/main/java/scala/tools/asm/util/TraceClassVisitor.java | 2 +- src/main/java/scala/tools/asm/util/TraceFieldVisitor.java | 2 +- src/main/java/scala/tools/asm/util/TraceMethodVisitor.java | 2 +- src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java | 2 +- 82 files changed, 82 insertions(+), 82 deletions(-) diff --git a/src/main/java/scala/tools/asm/AnnotationVisitor.java b/src/main/java/scala/tools/asm/AnnotationVisitor.java index b644083..b7b5476 100644 --- a/src/main/java/scala/tools/asm/AnnotationVisitor.java +++ b/src/main/java/scala/tools/asm/AnnotationVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A visitor to visit a Java annotation. The methods of this class must be diff --git a/src/main/java/scala/tools/asm/AnnotationWriter.java b/src/main/java/scala/tools/asm/AnnotationWriter.java index 6b95608..16014f5 100644 --- a/src/main/java/scala/tools/asm/AnnotationWriter.java +++ b/src/main/java/scala/tools/asm/AnnotationWriter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * An {@link AnnotationVisitor} that generates annotations in bytecode form. diff --git a/src/main/java/scala/tools/asm/Attribute.java b/src/main/java/scala/tools/asm/Attribute.java index 8a2a882..8d72a2c 100644 --- a/src/main/java/scala/tools/asm/Attribute.java +++ b/src/main/java/scala/tools/asm/Attribute.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A non standard class, field, method or code attribute. diff --git a/src/main/java/scala/tools/asm/ByteVector.java b/src/main/java/scala/tools/asm/ByteVector.java index 9c532be..284468e 100644 --- a/src/main/java/scala/tools/asm/ByteVector.java +++ b/src/main/java/scala/tools/asm/ByteVector.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A dynamically extensible vector of bytes. This class is roughly equivalent to diff --git a/src/main/java/scala/tools/asm/ClassReader.java b/src/main/java/scala/tools/asm/ClassReader.java index 76b1600..85e27f9 100644 --- a/src/main/java/scala/tools/asm/ClassReader.java +++ b/src/main/java/scala/tools/asm/ClassReader.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/scala/tools/asm/ClassVisitor.java b/src/main/java/scala/tools/asm/ClassVisitor.java index 107ada0..1b84507 100644 --- a/src/main/java/scala/tools/asm/ClassVisitor.java +++ b/src/main/java/scala/tools/asm/ClassVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A visitor to visit a Java class. The methods of this class must be called in diff --git a/src/main/java/scala/tools/asm/ClassWriter.java b/src/main/java/scala/tools/asm/ClassWriter.java index f4dd6c6..6625e47 100644 --- a/src/main/java/scala/tools/asm/ClassWriter.java +++ b/src/main/java/scala/tools/asm/ClassWriter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A {@link ClassVisitor} that generates classes in bytecode form. More diff --git a/src/main/java/scala/tools/asm/Context.java b/src/main/java/scala/tools/asm/Context.java index 2702784..872ef28 100644 --- a/src/main/java/scala/tools/asm/Context.java +++ b/src/main/java/scala/tools/asm/Context.java @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * Information about a class being parsed in a {@link ClassReader}. diff --git a/src/main/java/scala/tools/asm/Edge.java b/src/main/java/scala/tools/asm/Edge.java index 4e87cba..65e128a 100644 --- a/src/main/java/scala/tools/asm/Edge.java +++ b/src/main/java/scala/tools/asm/Edge.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * An edge in the control flow graph of a method body. See {@link Label Label}. diff --git a/src/main/java/scala/tools/asm/FieldVisitor.java b/src/main/java/scala/tools/asm/FieldVisitor.java index 2372e4c..7448720 100644 --- a/src/main/java/scala/tools/asm/FieldVisitor.java +++ b/src/main/java/scala/tools/asm/FieldVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A visitor to visit a Java field. The methods of this class must be called in diff --git a/src/main/java/scala/tools/asm/FieldWriter.java b/src/main/java/scala/tools/asm/FieldWriter.java index 84d92aa..cf33c04 100644 --- a/src/main/java/scala/tools/asm/FieldWriter.java +++ b/src/main/java/scala/tools/asm/FieldWriter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * An {@link FieldVisitor} that generates Java fields in bytecode form. diff --git a/src/main/java/scala/tools/asm/Frame.java b/src/main/java/scala/tools/asm/Frame.java index 1f6106f..94008ac 100644 --- a/src/main/java/scala/tools/asm/Frame.java +++ b/src/main/java/scala/tools/asm/Frame.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * Information about the input and output stack map frames of a basic block. diff --git a/src/main/java/scala/tools/asm/Handle.java b/src/main/java/scala/tools/asm/Handle.java index ddc0368..620295e 100644 --- a/src/main/java/scala/tools/asm/Handle.java +++ b/src/main/java/scala/tools/asm/Handle.java @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A reference to a field or a method. diff --git a/src/main/java/scala/tools/asm/Handler.java b/src/main/java/scala/tools/asm/Handler.java index b24591d..b3db4ce 100644 --- a/src/main/java/scala/tools/asm/Handler.java +++ b/src/main/java/scala/tools/asm/Handler.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * Information about an exception handler block. diff --git a/src/main/java/scala/tools/asm/Item.java b/src/main/java/scala/tools/asm/Item.java index 917524d..68ff809 100644 --- a/src/main/java/scala/tools/asm/Item.java +++ b/src/main/java/scala/tools/asm/Item.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A constant pool item. Constant pool items can be created with the 'newXXX' diff --git a/src/main/java/scala/tools/asm/Label.java b/src/main/java/scala/tools/asm/Label.java index 6bca6fb..d6f732c 100644 --- a/src/main/java/scala/tools/asm/Label.java +++ b/src/main/java/scala/tools/asm/Label.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A label represents a position in the bytecode of a method. Labels are used diff --git a/src/main/java/scala/tools/asm/MethodVisitor.java b/src/main/java/scala/tools/asm/MethodVisitor.java index f0927e8..559ba0f 100644 --- a/src/main/java/scala/tools/asm/MethodVisitor.java +++ b/src/main/java/scala/tools/asm/MethodVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A visitor to visit a Java method. The methods of this class must be called in diff --git a/src/main/java/scala/tools/asm/MethodWriter.java b/src/main/java/scala/tools/asm/MethodWriter.java index 5d30ddc..08eb71f 100644 --- a/src/main/java/scala/tools/asm/MethodWriter.java +++ b/src/main/java/scala/tools/asm/MethodWriter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A {@link MethodVisitor} that generates methods in bytecode form. Each visit diff --git a/src/main/java/scala/tools/asm/Opcodes.java b/src/main/java/scala/tools/asm/Opcodes.java index e5c2b33..793f0d7 100644 --- a/src/main/java/scala/tools/asm/Opcodes.java +++ b/src/main/java/scala/tools/asm/Opcodes.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * Defines the JVM opcodes, access flags and array type codes. This interface diff --git a/src/main/java/scala/tools/asm/Type.java b/src/main/java/scala/tools/asm/Type.java index 6561fea..b23888e 100644 --- a/src/main/java/scala/tools/asm/Type.java +++ b/src/main/java/scala/tools/asm/Type.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; import java.lang.reflect.Constructor; import java.lang.reflect.Method; diff --git a/src/main/java/scala/tools/asm/TypePath.java b/src/main/java/scala/tools/asm/TypePath.java index b2b3232..57888d5 100644 --- a/src/main/java/scala/tools/asm/TypePath.java +++ b/src/main/java/scala/tools/asm/TypePath.java @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * The path to a type argument, wildcard bound, array element type, or static diff --git a/src/main/java/scala/tools/asm/TypeReference.java b/src/main/java/scala/tools/asm/TypeReference.java index 2654b5d..4dba4c1 100644 --- a/src/main/java/scala/tools/asm/TypeReference.java +++ b/src/main/java/scala/tools/asm/TypeReference.java @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm; +package scala.tools.asm; /** * A reference to a type appearing in a class, field or method declaration, or diff --git a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java index f4c7aec..07c1af7 100644 --- a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java +++ b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.commons; +package scala.tools.asm.commons; import org.objectweb.asm.Handle; import org.objectweb.asm.Label; diff --git a/src/main/java/scala/tools/asm/signature/SignatureReader.java b/src/main/java/scala/tools/asm/signature/SignatureReader.java index 1083b3d..ecddf29 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureReader.java +++ b/src/main/java/scala/tools/asm/signature/SignatureReader.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.signature; +package scala.tools.asm.signature; /** * A type signature parser to make a signature visitor visit an existing diff --git a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java index 1dba32d..6fd1966 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java +++ b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.signature; +package scala.tools.asm.signature; import org.objectweb.asm.Opcodes; diff --git a/src/main/java/scala/tools/asm/signature/SignatureWriter.java b/src/main/java/scala/tools/asm/signature/SignatureWriter.java index cbd0d30..d707407 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureWriter.java +++ b/src/main/java/scala/tools/asm/signature/SignatureWriter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.signature; +package scala.tools.asm.signature; import org.objectweb.asm.Opcodes; diff --git a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java index 583be7f..82349bf 100644 --- a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/AnnotationNode.java b/src/main/java/scala/tools/asm/tree/AnnotationNode.java index 18bb60d..2894b4b 100644 --- a/src/main/java/scala/tools/asm/tree/AnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/AnnotationNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/ClassNode.java b/src/main/java/scala/tools/asm/tree/ClassNode.java index 4920796..1945b2b 100644 --- a/src/main/java/scala/tools/asm/tree/ClassNode.java +++ b/src/main/java/scala/tools/asm/tree/ClassNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java index 9b0c95f..a059daf 100644 --- a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/FieldNode.java b/src/main/java/scala/tools/asm/tree/FieldNode.java index 6a8d226..05e8516 100644 --- a/src/main/java/scala/tools/asm/tree/FieldNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/FrameNode.java b/src/main/java/scala/tools/asm/tree/FrameNode.java index bd1ea70..87d6afc 100644 --- a/src/main/java/scala/tools/asm/tree/FrameNode.java +++ b/src/main/java/scala/tools/asm/tree/FrameNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/scala/tools/asm/tree/IincInsnNode.java b/src/main/java/scala/tools/asm/tree/IincInsnNode.java index 5305b35..a586a9e 100644 --- a/src/main/java/scala/tools/asm/tree/IincInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IincInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/InnerClassNode.java b/src/main/java/scala/tools/asm/tree/InnerClassNode.java index 5198cfb..75953d7 100644 --- a/src/main/java/scala/tools/asm/tree/InnerClassNode.java +++ b/src/main/java/scala/tools/asm/tree/InnerClassNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import org.objectweb.asm.ClassVisitor; diff --git a/src/main/java/scala/tools/asm/tree/InsnList.java b/src/main/java/scala/tools/asm/tree/InsnList.java index fadaeb5..768d68c 100644 --- a/src/main/java/scala/tools/asm/tree/InsnList.java +++ b/src/main/java/scala/tools/asm/tree/InsnList.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ListIterator; import java.util.NoSuchElementException; diff --git a/src/main/java/scala/tools/asm/tree/InsnNode.java b/src/main/java/scala/tools/asm/tree/InsnNode.java index f6feba7..a0ca4a9 100644 --- a/src/main/java/scala/tools/asm/tree/InsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/IntInsnNode.java b/src/main/java/scala/tools/asm/tree/IntInsnNode.java index 6d8e7cd..c80a41a 100644 --- a/src/main/java/scala/tools/asm/tree/IntInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IntInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java index 55e3a6a..a7e6b44 100644 --- a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java index 5c461f3..8ffc591 100644 --- a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/LabelNode.java b/src/main/java/scala/tools/asm/tree/LabelNode.java index b6381bd..85377ae 100644 --- a/src/main/java/scala/tools/asm/tree/LabelNode.java +++ b/src/main/java/scala/tools/asm/tree/LabelNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java index 7441a42..7a8f2d1 100644 --- a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/LineNumberNode.java b/src/main/java/scala/tools/asm/tree/LineNumberNode.java index cda1694..c0a3108 100644 --- a/src/main/java/scala/tools/asm/tree/LineNumberNode.java +++ b/src/main/java/scala/tools/asm/tree/LineNumberNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java index 4ca7da4..d1b4836 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java @@ -28,7 +28,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java index 033f83e..b6bef1b 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import org.objectweb.asm.MethodVisitor; diff --git a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java index 39f7ef1..aae7a9c 100644 --- a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java index 02215f4..f392716 100644 --- a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/MethodNode.java b/src/main/java/scala/tools/asm/tree/MethodNode.java index 1edb4a7..209ef6e 100644 --- a/src/main/java/scala/tools/asm/tree/MethodNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java index 8e42d2d..62ea423 100644 --- a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/ParameterNode.java b/src/main/java/scala/tools/asm/tree/ParameterNode.java index 31360b8..b53f5c3 100644 --- a/src/main/java/scala/tools/asm/tree/ParameterNode.java +++ b/src/main/java/scala/tools/asm/tree/ParameterNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import org.objectweb.asm.MethodVisitor; diff --git a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java index 3e8937e..1527cf9 100644 --- a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java index 7a33a9f..379be90 100644 --- a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java +++ b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java index 93228b0..de375af 100644 --- a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import org.objectweb.asm.Opcodes; import org.objectweb.asm.TypePath; diff --git a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java index 859b57c..b1e4571 100644 --- a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/VarInsnNode.java b/src/main/java/scala/tools/asm/tree/VarInsnNode.java index d813d6e..8f5af6c 100644 --- a/src/main/java/scala/tools/asm/tree/VarInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/VarInsnNode.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree; +package scala.tools.asm.tree; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java index 381e8af..e6e3c30 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java index 6487912..7d1269d 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java +++ b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import org.objectweb.asm.tree.AbstractInsnNode; diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java index 7db7ce6..8e6e147 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java index 78316ae..067b684 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import org.objectweb.asm.Type; diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java index a542247..a785821 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Frame.java b/src/main/java/scala/tools/asm/tree/analysis/Frame.java index 5047bf7..782fae3 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Frame.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Frame.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java index 94e08ea..fece77c 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java index c8ee087..0da1db6 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java b/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java index 0cf6ccf..56472e1 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.AbstractSet; import java.util.HashSet; diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java index a5531df..d666fea 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.HashSet; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java index f87fc9e..3f67881 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.Set; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java index 2739671..7cb0826 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Value.java b/src/main/java/scala/tools/asm/tree/analysis/Value.java index 7545dce..63a293b 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Value.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Value.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.tree.analysis; +package scala.tools.asm.tree.analysis; /** * An immutable symbolic value for semantic interpretation of bytecode. diff --git a/src/main/java/scala/tools/asm/util/ASMifiable.java b/src/main/java/scala/tools/asm/util/ASMifiable.java index dcefe67..e32e8be 100644 --- a/src/main/java/scala/tools/asm/util/ASMifiable.java +++ b/src/main/java/scala/tools/asm/util/ASMifiable.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/util/ASMifier.java b/src/main/java/scala/tools/asm/util/ASMifier.java index aea8554..8148866 100644 --- a/src/main/java/scala/tools/asm/util/ASMifier.java +++ b/src/main/java/scala/tools/asm/util/ASMifier.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.io.FileInputStream; import java.io.PrintWriter; diff --git a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java index d9c0bdd..e6015ac 100644 --- a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.Opcodes; diff --git a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java index 210e238..52e7ad6 100644 --- a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.io.FileInputStream; import java.io.PrintWriter; diff --git a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java index 0b2e0e5..a32c841 100644 --- a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.Attribute; diff --git a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java index 63edb06..886907b 100644 --- a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java index 9226b4d..f11958a 100644 --- a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import org.objectweb.asm.Opcodes; import org.objectweb.asm.signature.SignatureVisitor; diff --git a/src/main/java/scala/tools/asm/util/Printer.java b/src/main/java/scala/tools/asm/util/Printer.java index 742aa3a..b1d57bc 100644 --- a/src/main/java/scala/tools/asm/util/Printer.java +++ b/src/main/java/scala/tools/asm/util/Printer.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.io.PrintWriter; import java.util.ArrayList; diff --git a/src/main/java/scala/tools/asm/util/Textifiable.java b/src/main/java/scala/tools/asm/util/Textifiable.java index aad97ba..356a6b3 100644 --- a/src/main/java/scala/tools/asm/util/Textifiable.java +++ b/src/main/java/scala/tools/asm/util/Textifiable.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.util.Map; diff --git a/src/main/java/scala/tools/asm/util/Textifier.java b/src/main/java/scala/tools/asm/util/Textifier.java index 895c7e2..dff16ed 100644 --- a/src/main/java/scala/tools/asm/util/Textifier.java +++ b/src/main/java/scala/tools/asm/util/Textifier.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.io.FileInputStream; import java.io.PrintWriter; diff --git a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java index 84d6196..ae32084 100644 --- a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.Opcodes; diff --git a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java index 3ca5978..9712215 100644 --- a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import java.io.PrintWriter; diff --git a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java index dbb3be0..98d8779 100644 --- a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.Attribute; diff --git a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java index 5f72ac6..c768969 100644 --- a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.Attribute; diff --git a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java index 20d426e..0d59d47 100644 --- a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java @@ -27,7 +27,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -package org.objectweb.asm.util; +package scala.tools.asm.util; import org.objectweb.asm.Opcodes; import org.objectweb.asm.signature.SignatureVisitor; From ca53ab1a13adc202efcd60e03faa1a1b0c1fb632 Mon Sep 17 00:00:00 2001 From: Carsten Varming Date: Mon, 18 Jul 2016 12:29:41 -0400 Subject: [PATCH 03/17] update imports --- .../tools/asm/commons/CodeSizeEvaluator.java | 8 ++--- .../tools/asm/signature/SignatureVisitor.java | 2 +- .../tools/asm/signature/SignatureWriter.java | 2 +- .../tools/asm/tree/AbstractInsnNode.java | 2 +- .../scala/tools/asm/tree/AnnotationNode.java | 4 +-- .../java/scala/tools/asm/tree/ClassNode.java | 14 ++++---- .../scala/tools/asm/tree/FieldInsnNode.java | 2 +- .../java/scala/tools/asm/tree/FieldNode.java | 12 +++---- .../java/scala/tools/asm/tree/FrameNode.java | 4 +-- .../scala/tools/asm/tree/IincInsnNode.java | 4 +-- .../scala/tools/asm/tree/InnerClassNode.java | 2 +- .../java/scala/tools/asm/tree/InsnList.java | 2 +- .../java/scala/tools/asm/tree/InsnNode.java | 2 +- .../scala/tools/asm/tree/IntInsnNode.java | 2 +- .../tools/asm/tree/InvokeDynamicInsnNode.java | 6 ++-- .../scala/tools/asm/tree/JumpInsnNode.java | 2 +- .../java/scala/tools/asm/tree/LabelNode.java | 4 +-- .../scala/tools/asm/tree/LdcInsnNode.java | 4 +-- .../scala/tools/asm/tree/LineNumberNode.java | 2 +- .../asm/tree/LocalVariableAnnotationNode.java | 10 +++--- .../tools/asm/tree/LocalVariableNode.java | 2 +- .../tools/asm/tree/LookupSwitchInsnNode.java | 6 ++-- .../scala/tools/asm/tree/MethodInsnNode.java | 4 +-- .../java/scala/tools/asm/tree/MethodNode.java | 18 +++++----- .../asm/tree/MultiANewArrayInsnNode.java | 4 +-- .../scala/tools/asm/tree/ParameterNode.java | 2 +- .../tools/asm/tree/TableSwitchInsnNode.java | 6 ++-- .../tools/asm/tree/TryCatchBlockNode.java | 2 +- .../tools/asm/tree/TypeAnnotationNode.java | 6 ++-- .../scala/tools/asm/tree/TypeInsnNode.java | 2 +- .../scala/tools/asm/tree/VarInsnNode.java | 2 +- .../tools/asm/tree/analysis/Analyzer.java | 24 ++++++------- .../asm/tree/analysis/AnalyzerException.java | 2 +- .../asm/tree/analysis/BasicInterpreter.java | 22 ++++++------ .../tools/asm/tree/analysis/BasicValue.java | 2 +- .../asm/tree/analysis/BasicVerifier.java | 10 +++--- .../scala/tools/asm/tree/analysis/Frame.java | 16 ++++----- .../tools/asm/tree/analysis/Interpreter.java | 4 +-- .../asm/tree/analysis/SimpleVerifier.java | 2 +- .../asm/tree/analysis/SourceInterpreter.java | 14 ++++---- .../tools/asm/tree/analysis/SourceValue.java | 2 +- .../tools/asm/tree/analysis/Subroutine.java | 4 +-- .../java/scala/tools/asm/util/ASMifiable.java | 2 +- .../java/scala/tools/asm/util/ASMifier.java | 16 ++++----- .../asm/util/CheckAnnotationAdapter.java | 6 ++-- .../tools/asm/util/CheckClassAdapter.java | 34 +++++++++---------- .../tools/asm/util/CheckFieldAdapter.java | 12 +++---- .../tools/asm/util/CheckMethodAdapter.java | 26 +++++++------- .../tools/asm/util/CheckSignatureAdapter.java | 4 +-- .../java/scala/tools/asm/util/Printer.java | 10 +++--- .../scala/tools/asm/util/Textifiable.java | 2 +- .../java/scala/tools/asm/util/Textifier.java | 18 +++++----- .../asm/util/TraceAnnotationVisitor.java | 4 +-- .../tools/asm/util/TraceClassVisitor.java | 14 ++++---- .../tools/asm/util/TraceFieldVisitor.java | 10 +++--- .../tools/asm/util/TraceMethodVisitor.java | 14 ++++---- .../tools/asm/util/TraceSignatureVisitor.java | 4 +-- 57 files changed, 211 insertions(+), 211 deletions(-) diff --git a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java index 07c1af7..e4e207a 100644 --- a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java +++ b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java @@ -29,10 +29,10 @@ */ package scala.tools.asm.commons; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.Handle; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A {@link MethodVisitor} that can be used to approximate method size. diff --git a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java index 6fd1966..66a8acb 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java +++ b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java @@ -29,7 +29,7 @@ */ package scala.tools.asm.signature; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.Opcodes; /** * A visitor to visit a generic signature. The methods of this interface must be diff --git a/src/main/java/scala/tools/asm/signature/SignatureWriter.java b/src/main/java/scala/tools/asm/signature/SignatureWriter.java index d707407..663dfe0 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureWriter.java +++ b/src/main/java/scala/tools/asm/signature/SignatureWriter.java @@ -29,7 +29,7 @@ */ package scala.tools.asm.signature; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.Opcodes; /** * A signature visitor that generates signatures in string format. diff --git a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java index 82349bf..63960a7 100644 --- a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java @@ -33,7 +33,7 @@ import java.util.List; import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a bytecode instruction. An instruction can appear diff --git a/src/main/java/scala/tools/asm/tree/AnnotationNode.java b/src/main/java/scala/tools/asm/tree/AnnotationNode.java index 2894b4b..15156be 100644 --- a/src/main/java/scala/tools/asm/tree/AnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/AnnotationNode.java @@ -32,8 +32,8 @@ import java.util.ArrayList; import java.util.List; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents an annotationn. diff --git a/src/main/java/scala/tools/asm/tree/ClassNode.java b/src/main/java/scala/tools/asm/tree/ClassNode.java index 1945b2b..8c81c17 100644 --- a/src/main/java/scala/tools/asm/tree/ClassNode.java +++ b/src/main/java/scala/tools/asm/tree/ClassNode.java @@ -33,13 +33,13 @@ import java.util.Arrays; import java.util.List; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.ClassVisitor; +import scala.tools.asm.FieldVisitor; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; /** * A node that represents a class. diff --git a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java index a059daf..ed03688 100644 --- a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a field instruction. A field instruction is an diff --git a/src/main/java/scala/tools/asm/tree/FieldNode.java b/src/main/java/scala/tools/asm/tree/FieldNode.java index 05e8516..2da6f38 100644 --- a/src/main/java/scala/tools/asm/tree/FieldNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldNode.java @@ -32,12 +32,12 @@ import java.util.ArrayList; import java.util.List; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.ClassVisitor; +import scala.tools.asm.FieldVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; /** * A node that represents a field. diff --git a/src/main/java/scala/tools/asm/tree/FrameNode.java b/src/main/java/scala/tools/asm/tree/FrameNode.java index 87d6afc..e4c7e7d 100644 --- a/src/main/java/scala/tools/asm/tree/FrameNode.java +++ b/src/main/java/scala/tools/asm/tree/FrameNode.java @@ -34,8 +34,8 @@ import java.util.List; import java.util.Map; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents a stack map frame. These nodes are pseudo instruction diff --git a/src/main/java/scala/tools/asm/tree/IincInsnNode.java b/src/main/java/scala/tools/asm/tree/IincInsnNode.java index a586a9e..88340d9 100644 --- a/src/main/java/scala/tools/asm/tree/IincInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IincInsnNode.java @@ -31,8 +31,8 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents an IINC instruction. diff --git a/src/main/java/scala/tools/asm/tree/InnerClassNode.java b/src/main/java/scala/tools/asm/tree/InnerClassNode.java index 75953d7..3249aad 100644 --- a/src/main/java/scala/tools/asm/tree/InnerClassNode.java +++ b/src/main/java/scala/tools/asm/tree/InnerClassNode.java @@ -29,7 +29,7 @@ */ package scala.tools.asm.tree; -import org.objectweb.asm.ClassVisitor; +import scala.tools.asm.ClassVisitor; /** * A node that represents an inner class. diff --git a/src/main/java/scala/tools/asm/tree/InsnList.java b/src/main/java/scala/tools/asm/tree/InsnList.java index 768d68c..fa6ceeb 100644 --- a/src/main/java/scala/tools/asm/tree/InsnList.java +++ b/src/main/java/scala/tools/asm/tree/InsnList.java @@ -32,7 +32,7 @@ import java.util.ListIterator; import java.util.NoSuchElementException; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A doubly linked list of {@link AbstractInsnNode} objects. This diff --git a/src/main/java/scala/tools/asm/tree/InsnNode.java b/src/main/java/scala/tools/asm/tree/InsnNode.java index a0ca4a9..71bd5e3 100644 --- a/src/main/java/scala/tools/asm/tree/InsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InsnNode.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a zero operand instruction. diff --git a/src/main/java/scala/tools/asm/tree/IntInsnNode.java b/src/main/java/scala/tools/asm/tree/IntInsnNode.java index c80a41a..1212dcb 100644 --- a/src/main/java/scala/tools/asm/tree/IntInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IntInsnNode.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents an instruction with a single int operand. diff --git a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java index a7e6b44..173b547 100644 --- a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java @@ -31,9 +31,9 @@ import java.util.Map; -import org.objectweb.asm.Handle; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.Handle; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents an invokedynamic instruction. diff --git a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java index 8ffc591..4fe2a16 100644 --- a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a jump instruction. A jump instruction is an diff --git a/src/main/java/scala/tools/asm/tree/LabelNode.java b/src/main/java/scala/tools/asm/tree/LabelNode.java index 85377ae..523a8d6 100644 --- a/src/main/java/scala/tools/asm/tree/LabelNode.java +++ b/src/main/java/scala/tools/asm/tree/LabelNode.java @@ -31,8 +31,8 @@ import java.util.Map; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; /** * An {@link AbstractInsnNode} that encapsulates a {@link Label}. diff --git a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java index 7a8f2d1..d5d709c 100644 --- a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java @@ -31,8 +31,8 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents an LDC instruction. diff --git a/src/main/java/scala/tools/asm/tree/LineNumberNode.java b/src/main/java/scala/tools/asm/tree/LineNumberNode.java index c0a3108..0e3fb48 100644 --- a/src/main/java/scala/tools/asm/tree/LineNumberNode.java +++ b/src/main/java/scala/tools/asm/tree/LineNumberNode.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a line number declaration. These nodes are pseudo diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java index d1b4836..638b60b 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java @@ -34,11 +34,11 @@ import java.util.Arrays; import java.util.List; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; -import org.objectweb.asm.TypeReference; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; +import scala.tools.asm.TypeReference; /** * A node that represents a type annotation on a local or resource variable. diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java index b6bef1b..d58f073 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java @@ -29,7 +29,7 @@ */ package scala.tools.asm.tree; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a local variable declaration. diff --git a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java index aae7a9c..d73eeee 100644 --- a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java @@ -34,9 +34,9 @@ import java.util.List; import java.util.Map; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents a LOOKUPSWITCH instruction. diff --git a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java index f392716..fc96efd 100644 --- a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java @@ -31,8 +31,8 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents a method instruction. A method instruction is an diff --git a/src/main/java/scala/tools/asm/tree/MethodNode.java b/src/main/java/scala/tools/asm/tree/MethodNode.java index 209ef6e..930e171 100644 --- a/src/main/java/scala/tools/asm/tree/MethodNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodNode.java @@ -33,15 +33,15 @@ import java.util.Arrays; import java.util.List; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.TypePath; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.ClassVisitor; +import scala.tools.asm.Handle; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.TypePath; /** * A node that represents a method. diff --git a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java index 62ea423..7e2aa79 100644 --- a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java @@ -31,8 +31,8 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents a MULTIANEWARRAY instruction. diff --git a/src/main/java/scala/tools/asm/tree/ParameterNode.java b/src/main/java/scala/tools/asm/tree/ParameterNode.java index b53f5c3..5cb7ebc 100644 --- a/src/main/java/scala/tools/asm/tree/ParameterNode.java +++ b/src/main/java/scala/tools/asm/tree/ParameterNode.java @@ -29,7 +29,7 @@ */ package scala.tools.asm.tree; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a parameter access and name. diff --git a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java index 1527cf9..1bbc870 100644 --- a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java @@ -34,9 +34,9 @@ import java.util.List; import java.util.Map; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; /** * A node that represents a TABLESWITCH instruction. diff --git a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java index 379be90..5e64d14 100644 --- a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java +++ b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java @@ -31,7 +31,7 @@ import java.util.List; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a try catch block. diff --git a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java index de375af..c5957f9 100644 --- a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java @@ -29,9 +29,9 @@ */ package scala.tools.asm.tree; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; -import org.objectweb.asm.TypeReference; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; +import scala.tools.asm.TypeReference; /** * A node that represents a type annotationn. diff --git a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java index b1e4571..cabe2b2 100644 --- a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a type instruction. A type instruction is an diff --git a/src/main/java/scala/tools/asm/tree/VarInsnNode.java b/src/main/java/scala/tools/asm/tree/VarInsnNode.java index 8f5af6c..76b5c38 100644 --- a/src/main/java/scala/tools/asm/tree/VarInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/VarInsnNode.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.MethodVisitor; +import scala.tools.asm.MethodVisitor; /** * A node that represents a local variable instruction. A local variable diff --git a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java index e6e3c30..a4bf933 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java @@ -34,18 +34,18 @@ import java.util.List; import java.util.Map; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.IincInsnNode; -import org.objectweb.asm.tree.InsnList; -import org.objectweb.asm.tree.JumpInsnNode; -import org.objectweb.asm.tree.LabelNode; -import org.objectweb.asm.tree.LookupSwitchInsnNode; -import org.objectweb.asm.tree.MethodNode; -import org.objectweb.asm.tree.TableSwitchInsnNode; -import org.objectweb.asm.tree.TryCatchBlockNode; -import org.objectweb.asm.tree.VarInsnNode; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.IincInsnNode; +import scala.tools.asm.tree.InsnList; +import scala.tools.asm.tree.JumpInsnNode; +import scala.tools.asm.tree.LabelNode; +import scala.tools.asm.tree.LookupSwitchInsnNode; +import scala.tools.asm.tree.MethodNode; +import scala.tools.asm.tree.TableSwitchInsnNode; +import scala.tools.asm.tree.TryCatchBlockNode; +import scala.tools.asm.tree.VarInsnNode; /** * A semantic bytecode analyzer. This class does not fully check that JSR and diff --git a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java index 7d1269d..99ae030 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java +++ b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java @@ -29,7 +29,7 @@ */ package scala.tools.asm.tree.analysis; -import org.objectweb.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.AbstractInsnNode; /** * Thrown if a problem occurs during the analysis of a method. diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java index 8e6e147..003461b 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java @@ -31,17 +31,17 @@ import java.util.List; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.FieldInsnNode; -import org.objectweb.asm.tree.IntInsnNode; -import org.objectweb.asm.tree.InvokeDynamicInsnNode; -import org.objectweb.asm.tree.LdcInsnNode; -import org.objectweb.asm.tree.MethodInsnNode; -import org.objectweb.asm.tree.MultiANewArrayInsnNode; -import org.objectweb.asm.tree.TypeInsnNode; +import scala.tools.asm.Handle; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.FieldInsnNode; +import scala.tools.asm.tree.IntInsnNode; +import scala.tools.asm.tree.InvokeDynamicInsnNode; +import scala.tools.asm.tree.LdcInsnNode; +import scala.tools.asm.tree.MethodInsnNode; +import scala.tools.asm.tree.MultiANewArrayInsnNode; +import scala.tools.asm.tree.TypeInsnNode; /** * An {@link Interpreter} for {@link BasicValue} values. diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java index 067b684..53ac1e3 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java @@ -29,7 +29,7 @@ */ package scala.tools.asm.tree.analysis; -import org.objectweb.asm.Type; +import scala.tools.asm.Type; /** * A {@link Value} that is represented by its type in a seven types type system. diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java index a785821..0b1b4c6 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java @@ -31,11 +31,11 @@ import java.util.List; -import org.objectweb.asm.Type; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.FieldInsnNode; -import org.objectweb.asm.tree.InvokeDynamicInsnNode; -import org.objectweb.asm.tree.MethodInsnNode; +import scala.tools.asm.Type; +import scala.tools.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.FieldInsnNode; +import scala.tools.asm.tree.InvokeDynamicInsnNode; +import scala.tools.asm.tree.MethodInsnNode; /** * An extended {@link BasicInterpreter} that checks that bytecode instructions diff --git a/src/main/java/scala/tools/asm/tree/analysis/Frame.java b/src/main/java/scala/tools/asm/tree/analysis/Frame.java index 782fae3..69fcc1b 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Frame.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Frame.java @@ -32,14 +32,14 @@ import java.util.ArrayList; import java.util.List; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.IincInsnNode; -import org.objectweb.asm.tree.InvokeDynamicInsnNode; -import org.objectweb.asm.tree.MethodInsnNode; -import org.objectweb.asm.tree.MultiANewArrayInsnNode; -import org.objectweb.asm.tree.VarInsnNode; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.IincInsnNode; +import scala.tools.asm.tree.InvokeDynamicInsnNode; +import scala.tools.asm.tree.MethodInsnNode; +import scala.tools.asm.tree.MultiANewArrayInsnNode; +import scala.tools.asm.tree.VarInsnNode; /** * A symbolic execution stack frame. A stack frame contains a set of local diff --git a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java index fece77c..782c3eb 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java @@ -31,8 +31,8 @@ import java.util.List; -import org.objectweb.asm.Type; -import org.objectweb.asm.tree.AbstractInsnNode; +import scala.tools.asm.Type; +import scala.tools.asm.tree.AbstractInsnNode; /** * A semantic bytecode interpreter. More precisely, this interpreter only diff --git a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java index 0da1db6..0471a4c 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java @@ -31,7 +31,7 @@ import java.util.List; -import org.objectweb.asm.Type; +import scala.tools.asm.Type; /** * An extended {@link BasicVerifier} that performs more precise verifications. diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java index d666fea..8a24652 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java @@ -33,13 +33,13 @@ import java.util.List; import java.util.Set; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.FieldInsnNode; -import org.objectweb.asm.tree.InvokeDynamicInsnNode; -import org.objectweb.asm.tree.LdcInsnNode; -import org.objectweb.asm.tree.MethodInsnNode; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.FieldInsnNode; +import scala.tools.asm.tree.InvokeDynamicInsnNode; +import scala.tools.asm.tree.LdcInsnNode; +import scala.tools.asm.tree.MethodInsnNode; /** * An {@link Interpreter} for {@link SourceValue} values. diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java index 3f67881..ed648a0e 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java @@ -31,7 +31,7 @@ import java.util.Set; -import org.objectweb.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.AbstractInsnNode; /** * A {@link Value} that is represented by its type in a two types type system. diff --git a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java index 7cb0826..5762cb8 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java @@ -32,8 +32,8 @@ import java.util.ArrayList; import java.util.List; -import org.objectweb.asm.tree.JumpInsnNode; -import org.objectweb.asm.tree.LabelNode; +import scala.tools.asm.tree.JumpInsnNode; +import scala.tools.asm.tree.LabelNode; /** * A method subroutine (corresponds to a JSR instruction). diff --git a/src/main/java/scala/tools/asm/util/ASMifiable.java b/src/main/java/scala/tools/asm/util/ASMifiable.java index e32e8be..272d895 100644 --- a/src/main/java/scala/tools/asm/util/ASMifiable.java +++ b/src/main/java/scala/tools/asm/util/ASMifiable.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.Label; +import scala.tools.asm.Label; /** * An {@link org.objectweb.asm.Attribute Attribute} that can print the ASM code diff --git a/src/main/java/scala/tools/asm/util/ASMifier.java b/src/main/java/scala/tools/asm/util/ASMifier.java index 8148866..be95b9e 100644 --- a/src/main/java/scala/tools/asm/util/ASMifier.java +++ b/src/main/java/scala/tools/asm/util/ASMifier.java @@ -34,13 +34,13 @@ import java.util.HashMap; import java.util.Map; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Label; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.TypePath; +import scala.tools.asm.Attribute; +import scala.tools.asm.ClassReader; +import scala.tools.asm.Handle; +import scala.tools.asm.Label; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.TypePath; /** * A {@link Printer} that prints the ASM code to generate the classes if visits. @@ -176,7 +176,7 @@ public void visit(final int version, final int access, final String name, simpleName = name.substring(n + 1); } text.add("import java.util.*;\n"); - text.add("import org.objectweb.asm.*;\n"); + text.add("import scala.tools.asm.*;\n"); text.add("public class " + simpleName + "Dump implements Opcodes {\n\n"); text.add("public static byte[] dump () throws Exception {\n\n"); text.add("ClassWriter cw = new ClassWriter(0);\n"); diff --git a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java index e6015ac..7f07e7d 100644 --- a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java @@ -29,9 +29,9 @@ */ package scala.tools.asm.util; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; /** * An {@link AnnotationVisitor} that checks that its methods are properly used. diff --git a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java index 52e7ad6..fca5734 100644 --- a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java @@ -37,23 +37,23 @@ import java.util.List; import java.util.Map; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.TypePath; -import org.objectweb.asm.TypeReference; -import org.objectweb.asm.tree.ClassNode; -import org.objectweb.asm.tree.MethodNode; -import org.objectweb.asm.tree.analysis.Analyzer; -import org.objectweb.asm.tree.analysis.BasicValue; -import org.objectweb.asm.tree.analysis.Frame; -import org.objectweb.asm.tree.analysis.SimpleVerifier; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.ClassReader; +import scala.tools.asm.ClassVisitor; +import scala.tools.asm.FieldVisitor; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.TypePath; +import scala.tools.asm.TypeReference; +import scala.tools.asm.tree.ClassNode; +import scala.tools.asm.tree.MethodNode; +import scala.tools.asm.tree.analysis.Analyzer; +import scala.tools.asm.tree.analysis.BasicValue; +import scala.tools.asm.tree.analysis.Frame; +import scala.tools.asm.tree.analysis.SimpleVerifier; /** * A {@link ClassVisitor} that checks that its methods are properly used. More diff --git a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java index a32c841..5a93f48 100644 --- a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java @@ -29,12 +29,12 @@ */ package scala.tools.asm.util; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; -import org.objectweb.asm.TypeReference; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.FieldVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; +import scala.tools.asm.TypeReference; /** * A {@link FieldVisitor} that checks that its methods are properly used. diff --git a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java index 886907b..da84a24 100644 --- a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java @@ -39,19 +39,19 @@ import java.util.Map; import java.util.Set; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.TypePath; -import org.objectweb.asm.TypeReference; -import org.objectweb.asm.tree.MethodNode; -import org.objectweb.asm.tree.analysis.Analyzer; -import org.objectweb.asm.tree.analysis.BasicValue; -import org.objectweb.asm.tree.analysis.BasicVerifier; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.Handle; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.TypePath; +import scala.tools.asm.TypeReference; +import scala.tools.asm.tree.MethodNode; +import scala.tools.asm.tree.analysis.Analyzer; +import scala.tools.asm.tree.analysis.BasicValue; +import scala.tools.asm.tree.analysis.BasicVerifier; /** * A {@link MethodVisitor} that checks that its methods are properly used. More diff --git a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java index f11958a..9cad666 100644 --- a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java @@ -29,8 +29,8 @@ */ package scala.tools.asm.util; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.signature.SignatureVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.signature.SignatureVisitor; /** * A {@link SignatureVisitor} that checks that its methods are properly used. diff --git a/src/main/java/scala/tools/asm/util/Printer.java b/src/main/java/scala/tools/asm/util/Printer.java index b1d57bc..38d0845 100644 --- a/src/main/java/scala/tools/asm/util/Printer.java +++ b/src/main/java/scala/tools/asm/util/Printer.java @@ -33,11 +33,11 @@ import java.util.ArrayList; import java.util.List; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Label; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; +import scala.tools.asm.Attribute; +import scala.tools.asm.Handle; +import scala.tools.asm.Label; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; /** * An abstract converter from visit events to text. diff --git a/src/main/java/scala/tools/asm/util/Textifiable.java b/src/main/java/scala/tools/asm/util/Textifiable.java index 356a6b3..250bce4 100644 --- a/src/main/java/scala/tools/asm/util/Textifiable.java +++ b/src/main/java/scala/tools/asm/util/Textifiable.java @@ -31,7 +31,7 @@ import java.util.Map; -import org.objectweb.asm.Label; +import scala.tools.asm.Label; /** * An {@link org.objectweb.asm.Attribute Attribute} that can print a readable diff --git a/src/main/java/scala/tools/asm/util/Textifier.java b/src/main/java/scala/tools/asm/util/Textifier.java index dff16ed..8c71024 100644 --- a/src/main/java/scala/tools/asm/util/Textifier.java +++ b/src/main/java/scala/tools/asm/util/Textifier.java @@ -34,15 +34,15 @@ import java.util.HashMap; import java.util.Map; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Label; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.Type; -import org.objectweb.asm.TypePath; -import org.objectweb.asm.TypeReference; -import org.objectweb.asm.signature.SignatureReader; +import scala.tools.asm.Attribute; +import scala.tools.asm.ClassReader; +import scala.tools.asm.Handle; +import scala.tools.asm.Label; +import scala.tools.asm.Opcodes; +import scala.tools.asm.Type; +import scala.tools.asm.TypePath; +import scala.tools.asm.TypeReference; +import scala.tools.asm.signature.SignatureReader; /** * A {@link Printer} that prints a disassembled view of the classes it visits. diff --git a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java index ae32084..02d2963 100644 --- a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java @@ -29,8 +29,8 @@ */ package scala.tools.asm.util; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Opcodes; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Opcodes; /** * An {@link AnnotationVisitor} that prints the annotations it visits with a diff --git a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java index 9712215..a6a6722 100644 --- a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java @@ -31,13 +31,13 @@ import java.io.PrintWriter; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.ClassVisitor; +import scala.tools.asm.FieldVisitor; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; /** * A {@link ClassVisitor} that prints the classes it visits with a diff --git a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java index 98d8779..dc954fe 100644 --- a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java @@ -29,11 +29,11 @@ */ package scala.tools.asm.util; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.FieldVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; /** * A {@link FieldVisitor} that prints the fields it visits with a diff --git a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java index c768969..81cfcee 100644 --- a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java @@ -29,13 +29,13 @@ */ package scala.tools.asm.util; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.Handle; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.TypePath; +import scala.tools.asm.AnnotationVisitor; +import scala.tools.asm.Attribute; +import scala.tools.asm.Handle; +import scala.tools.asm.Label; +import scala.tools.asm.MethodVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.TypePath; /** * A {@link MethodVisitor} that prints the methods it visits with a diff --git a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java index 0d59d47..e68e3f4 100644 --- a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java @@ -29,8 +29,8 @@ */ package scala.tools.asm.util; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.signature.SignatureVisitor; +import scala.tools.asm.Opcodes; +import scala.tools.asm.signature.SignatureVisitor; /** * A {@link SignatureVisitor} that prints a disassembled view of the signature From bdefa61d9e89dd6d4e0ee1cce5d9d3f2ac5cd5d2 Mon Sep 17 00:00:00 2001 From: Carsten Varming Date: Mon, 18 Jul 2016 13:11:44 -0400 Subject: [PATCH 04/17] update @links, @associates --- src/main/java/scala/tools/asm/Label.java | 2 +- .../tools/asm/signature/SignatureReader.java | 8 +- .../tools/asm/tree/AbstractInsnNode.java | 4 +- .../scala/tools/asm/tree/AnnotationNode.java | 2 +- .../java/scala/tools/asm/tree/ClassNode.java | 24 +-- .../scala/tools/asm/tree/FieldInsnNode.java | 8 +- .../java/scala/tools/asm/tree/FieldNode.java | 22 +- .../scala/tools/asm/tree/InnerClassNode.java | 8 +- .../tools/asm/tree/InvokeDynamicInsnNode.java | 2 +- .../scala/tools/asm/tree/LdcInsnNode.java | 2 +- .../scala/tools/asm/tree/MethodInsnNode.java | 12 +- .../java/scala/tools/asm/tree/MethodNode.java | 24 +-- .../asm/tree/MultiANewArrayInsnNode.java | 4 +- .../scala/tools/asm/tree/ParameterNode.java | 4 +- .../tools/asm/tree/TryCatchBlockNode.java | 4 +- .../scala/tools/asm/tree/TypeInsnNode.java | 4 +- .../java/scala/tools/asm/util/ASMifiable.java | 2 +- .../tools/asm/util/CheckMethodAdapter.java | 2 +- .../java/scala/tools/asm/util/Printer.java | 194 +++++++++--------- .../scala/tools/asm/util/Textifiable.java | 2 +- 20 files changed, 167 insertions(+), 167 deletions(-) diff --git a/src/main/java/scala/tools/asm/Label.java b/src/main/java/scala/tools/asm/Label.java index d6f732c..45670df 100644 --- a/src/main/java/scala/tools/asm/Label.java +++ b/src/main/java/scala/tools/asm/Label.java @@ -111,7 +111,7 @@ public class Label { * Field used to associate user information to a label. Warning: this field * is used by the ASM tree package. In order to use it with the ASM tree * package you must override the - * {@link org.objectweb.asm.tree.MethodNode#getLabelNode} method. + * {@link scala.tools.asm.tree.MethodNode#getLabelNode} method. */ public Object info; diff --git a/src/main/java/scala/tools/asm/signature/SignatureReader.java b/src/main/java/scala/tools/asm/signature/SignatureReader.java index ecddf29..3cf9ff4 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureReader.java +++ b/src/main/java/scala/tools/asm/signature/SignatureReader.java @@ -60,10 +60,10 @@ public SignatureReader(final String signature) { * constructor (see {@link #SignatureReader(String) SignatureReader}). This * method is intended to be called on a {@link SignatureReader} that was * created using a ClassSignature (such as the signature - * parameter of the {@link org.objectweb.asm.ClassVisitor#visit + * parameter of the {@link scala.tools.asm.ClassVisitor#visit * ClassVisitor.visit} method) or a MethodTypeSignature (such as the * signature parameter of the - * {@link org.objectweb.asm.ClassVisitor#visitMethod + * {@link scala.tools.asm.ClassVisitor#visitMethod * ClassVisitor.visitMethod} method). * * @param v @@ -119,8 +119,8 @@ public void accept(final SignatureVisitor v) { * method is intended to be called on a {@link SignatureReader} that was * created using a FieldTypeSignature, such as the * signature parameter of the - * {@link org.objectweb.asm.ClassVisitor#visitField ClassVisitor.visitField} - * or {@link org.objectweb.asm.MethodVisitor#visitLocalVariable + * {@link scala.tools.asm.ClassVisitor#visitField ClassVisitor.visitField} + * or {@link scala.tools.asm.MethodVisitor#visitLocalVariable * MethodVisitor.visitLocalVariable} methods. * * @param v diff --git a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java index 63960a7..df92d44 100644 --- a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java @@ -134,7 +134,7 @@ public abstract class AbstractInsnNode { * number nodes). This list is a list of {@link TypeAnnotationNode} objects. * May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -145,7 +145,7 @@ public abstract class AbstractInsnNode { * number nodes). This list is a list of {@link TypeAnnotationNode} objects. * May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; diff --git a/src/main/java/scala/tools/asm/tree/AnnotationNode.java b/src/main/java/scala/tools/asm/tree/AnnotationNode.java index 15156be..1ac46f6 100644 --- a/src/main/java/scala/tools/asm/tree/AnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/AnnotationNode.java @@ -52,7 +52,7 @@ public class AnnotationNode extends AnnotationVisitor { * as two consecutive elements in the list. The name is a {@link String}, * and the value may be a {@link Byte}, {@link Boolean}, {@link Character}, * {@link Short}, {@link Integer}, {@link Long}, {@link Float}, - * {@link Double}, {@link String} or {@link org.objectweb.asm.Type}, or an + * {@link Double}, {@link String} or {@link scala.tools.asm.Type}, or an * two elements String array (for enumeration values), a * {@link AnnotationNode}, or a {@link List} of values of one of the * preceding types. The list may be null if there is no name value diff --git a/src/main/java/scala/tools/asm/tree/ClassNode.java b/src/main/java/scala/tools/asm/tree/ClassNode.java index 8c81c17..2c68305 100644 --- a/src/main/java/scala/tools/asm/tree/ClassNode.java +++ b/src/main/java/scala/tools/asm/tree/ClassNode.java @@ -54,14 +54,14 @@ public class ClassNode extends ClassVisitor { public int version; /** - * The class's access flags (see {@link org.objectweb.asm.Opcodes}). This + * The class's access flags (see {@link scala.tools.asm.Opcodes}). This * field also indicates if the class is deprecated. */ public int access; /** * The internal name of the class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). */ public String name; @@ -72,7 +72,7 @@ public class ClassNode extends ClassVisitor { /** * The internal of name of the super class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). For + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). For * interfaces, the super class is {@link Object}. May be null, but * only for the {@link Object} class. */ @@ -80,7 +80,7 @@ public class ClassNode extends ClassVisitor { /** * The internal names of the class's interfaces (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). This + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). This * list is a list of {@link String} objects. */ public List interfaces; @@ -119,7 +119,7 @@ public class ClassNode extends ClassVisitor { * The runtime visible annotations of this class. This list is a list of * {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label visible */ public List visibleAnnotations; @@ -128,7 +128,7 @@ public class ClassNode extends ClassVisitor { * The runtime invisible annotations of this class. This list is a list of * {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label invisible */ public List invisibleAnnotations; @@ -137,7 +137,7 @@ public class ClassNode extends ClassVisitor { * The runtime visible type annotations of this class. This list is a list * of {@link TypeAnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -146,7 +146,7 @@ public class ClassNode extends ClassVisitor { * The runtime invisible type annotations of this class. This list is a list * of {@link TypeAnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; @@ -155,7 +155,7 @@ public class ClassNode extends ClassVisitor { * The non standard attributes of this class. This list is a list of * {@link Attribute} objects. May be null. * - * @associates org.objectweb.asm.Attribute + * @associates scala.tools.asm.Attribute */ public List attrs; @@ -163,7 +163,7 @@ public class ClassNode extends ClassVisitor { * Informations about the inner classes of this class. This list is a list * of {@link InnerClassNode} objects. * - * @associates org.objectweb.asm.tree.InnerClassNode + * @associates scala.tools.asm.tree.InnerClassNode */ public List innerClasses; @@ -171,7 +171,7 @@ public class ClassNode extends ClassVisitor { * The fields of this class. This list is a list of {@link FieldNode} * objects. * - * @associates org.objectweb.asm.tree.FieldNode + * @associates scala.tools.asm.tree.FieldNode */ public List fields; @@ -179,7 +179,7 @@ public class ClassNode extends ClassVisitor { * The methods of this class. This list is a list of {@link MethodNode} * objects. * - * @associates org.objectweb.asm.tree.MethodNode + * @associates scala.tools.asm.tree.MethodNode */ public List methods; diff --git a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java index ed03688..0e2892b 100644 --- a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java @@ -43,7 +43,7 @@ public class FieldInsnNode extends AbstractInsnNode { /** * The internal name of the field's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). */ public String owner; @@ -53,7 +53,7 @@ public class FieldInsnNode extends AbstractInsnNode { public String name; /** - * The field's descriptor (see {@link org.objectweb.asm.Type}). + * The field's descriptor (see {@link scala.tools.asm.Type}). */ public String desc; @@ -65,12 +65,12 @@ public class FieldInsnNode extends AbstractInsnNode { * opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. * @param owner * the internal name of the field's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() + * {@link scala.tools.asm.Type#getInternalName() * getInternalName}). * @param name * the field's name. * @param desc - * the field's descriptor (see {@link org.objectweb.asm.Type}). + * the field's descriptor (see {@link scala.tools.asm.Type}). */ public FieldInsnNode(final int opcode, final String owner, final String name, final String desc) { diff --git a/src/main/java/scala/tools/asm/tree/FieldNode.java b/src/main/java/scala/tools/asm/tree/FieldNode.java index 2da6f38..ea85477 100644 --- a/src/main/java/scala/tools/asm/tree/FieldNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldNode.java @@ -47,7 +47,7 @@ public class FieldNode extends FieldVisitor { /** - * The field's access flags (see {@link org.objectweb.asm.Opcodes}). This + * The field's access flags (see {@link scala.tools.asm.Opcodes}). This * field also indicates if the field is synthetic and/or deprecated. */ public int access; @@ -58,7 +58,7 @@ public class FieldNode extends FieldVisitor { public String name; /** - * The field's descriptor (see {@link org.objectweb.asm.Type}). + * The field's descriptor (see {@link scala.tools.asm.Type}). */ public String desc; @@ -78,7 +78,7 @@ public class FieldNode extends FieldVisitor { * The runtime visible annotations of this field. This list is a list of * {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label visible */ public List visibleAnnotations; @@ -87,7 +87,7 @@ public class FieldNode extends FieldVisitor { * The runtime invisible annotations of this field. This list is a list of * {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label invisible */ public List invisibleAnnotations; @@ -96,7 +96,7 @@ public class FieldNode extends FieldVisitor { * The runtime visible type annotations of this field. This list is a list * of {@link TypeAnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -105,7 +105,7 @@ public class FieldNode extends FieldVisitor { * The runtime invisible type annotations of this field. This list is a list * of {@link TypeAnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; @@ -114,7 +114,7 @@ public class FieldNode extends FieldVisitor { * The non standard attributes of this field. This list is a list of * {@link Attribute} objects. May be null. * - * @associates org.objectweb.asm.Attribute + * @associates scala.tools.asm.Attribute */ public List attrs; @@ -125,12 +125,12 @@ public class FieldNode extends FieldVisitor { * * @param access * the field's access flags (see - * {@link org.objectweb.asm.Opcodes}). This parameter also + * {@link scala.tools.asm.Opcodes}). This parameter also * indicates if the field is synthetic and/or deprecated. * @param name * the field's name. * @param desc - * the field's descriptor (see {@link org.objectweb.asm.Type + * the field's descriptor (see {@link scala.tools.asm.Type * Type}). * @param signature * the field's signature. @@ -159,12 +159,12 @@ public FieldNode(final int access, final String name, final String desc, * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. * @param access * the field's access flags (see - * {@link org.objectweb.asm.Opcodes}). This parameter also + * {@link scala.tools.asm.Opcodes}). This parameter also * indicates if the field is synthetic and/or deprecated. * @param name * the field's name. * @param desc - * the field's descriptor (see {@link org.objectweb.asm.Type + * the field's descriptor (see {@link scala.tools.asm.Type * Type}). * @param signature * the field's signature. diff --git a/src/main/java/scala/tools/asm/tree/InnerClassNode.java b/src/main/java/scala/tools/asm/tree/InnerClassNode.java index 3249aad..130c5d7 100644 --- a/src/main/java/scala/tools/asm/tree/InnerClassNode.java +++ b/src/main/java/scala/tools/asm/tree/InnerClassNode.java @@ -40,13 +40,13 @@ public class InnerClassNode { /** * The internal name of an inner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). */ public String name; /** * The internal name of the class to which the inner class belongs (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). May be + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). May be * null. */ public String outerName; @@ -68,11 +68,11 @@ public class InnerClassNode { * * @param name * the internal name of an inner class (see - * {@link org.objectweb.asm.Type#getInternalName() + * {@link scala.tools.asm.Type#getInternalName() * getInternalName}). * @param outerName * the internal name of the class to which the inner class - * belongs (see {@link org.objectweb.asm.Type#getInternalName() + * belongs (see {@link scala.tools.asm.Type#getInternalName() * getInternalName}). May be null. * @param innerName * the (simple) name of the inner class inside its enclosing diff --git a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java index 173b547..dd21e11 100644 --- a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java @@ -68,7 +68,7 @@ public class InvokeDynamicInsnNode extends AbstractInsnNode { * @param name * invokedynamic name. * @param desc - * invokedynamic descriptor (see {@link org.objectweb.asm.Type}). + * invokedynamic descriptor (see {@link scala.tools.asm.Type}). * @param bsm * the bootstrap method. * @param bsmArgs diff --git a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java index d5d709c..92b6f70 100644 --- a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java @@ -44,7 +44,7 @@ public class LdcInsnNode extends AbstractInsnNode { /** * The constant to be loaded on the stack. This parameter must be a non null * {@link Integer}, a {@link Float}, a {@link Long}, a {@link Double}, a - * {@link String} or a {@link org.objectweb.asm.Type}. + * {@link String} or a {@link scala.tools.asm.Type}. */ public Object cst; diff --git a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java index fc96efd..5d06ec8 100644 --- a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java @@ -44,7 +44,7 @@ public class MethodInsnNode extends AbstractInsnNode { /** * The internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). */ public String owner; @@ -54,7 +54,7 @@ public class MethodInsnNode extends AbstractInsnNode { public String name; /** - * The method's descriptor (see {@link org.objectweb.asm.Type}). + * The method's descriptor (see {@link scala.tools.asm.Type}). */ public String desc; @@ -72,12 +72,12 @@ public class MethodInsnNode extends AbstractInsnNode { * INVOKEINTERFACE. * @param owner * the internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() + * {@link scala.tools.asm.Type#getInternalName() * getInternalName}). * @param name * the method's name. * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type}). + * the method's descriptor (see {@link scala.tools.asm.Type}). */ @Deprecated public MethodInsnNode(final int opcode, final String owner, @@ -94,12 +94,12 @@ public MethodInsnNode(final int opcode, final String owner, * INVOKEINTERFACE. * @param owner * the internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() + * {@link scala.tools.asm.Type#getInternalName() * getInternalName}). * @param name * the method's name. * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type}). + * the method's descriptor (see {@link scala.tools.asm.Type}). * @param itf * if the method's owner class is an interface. */ diff --git a/src/main/java/scala/tools/asm/tree/MethodNode.java b/src/main/java/scala/tools/asm/tree/MethodNode.java index 930e171..06ff7cb 100644 --- a/src/main/java/scala/tools/asm/tree/MethodNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodNode.java @@ -87,7 +87,7 @@ public class MethodNode extends MethodVisitor { * The runtime visible annotations of this method. This list is a list of * {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label visible */ public List visibleAnnotations; @@ -96,7 +96,7 @@ public class MethodNode extends MethodVisitor { * The runtime invisible annotations of this method. This list is a list of * {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label invisible */ public List invisibleAnnotations; @@ -105,7 +105,7 @@ public class MethodNode extends MethodVisitor { * The runtime visible type annotations of this method. This list is a list * of {@link TypeAnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -114,7 +114,7 @@ public class MethodNode extends MethodVisitor { * The runtime invisible type annotations of this method. This list is a * list of {@link TypeAnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; @@ -123,7 +123,7 @@ public class MethodNode extends MethodVisitor { * The non standard attributes of this method. This list is a list of * {@link Attribute} objects. May be null. * - * @associates org.objectweb.asm.Attribute + * @associates scala.tools.asm.Attribute */ public List attrs; @@ -141,7 +141,7 @@ public class MethodNode extends MethodVisitor { * The runtime visible parameter annotations of this method. These lists are * lists of {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label invisible parameters */ public List[] visibleParameterAnnotations; @@ -150,7 +150,7 @@ public class MethodNode extends MethodVisitor { * The runtime invisible parameter annotations of this method. These lists * are lists of {@link AnnotationNode} objects. May be null. * - * @associates org.objectweb.asm.tree.AnnotationNode + * @associates scala.tools.asm.tree.AnnotationNode * @label visible parameters */ public List[] invisibleParameterAnnotations; @@ -159,7 +159,7 @@ public class MethodNode extends MethodVisitor { * The instructions of this method. This list is a list of * {@link AbstractInsnNode} objects. * - * @associates org.objectweb.asm.tree.AbstractInsnNode + * @associates scala.tools.asm.tree.AbstractInsnNode * @label instructions */ public InsnList instructions; @@ -168,7 +168,7 @@ public class MethodNode extends MethodVisitor { * The try catch blocks of this method. This list is a list of * {@link TryCatchBlockNode} objects. * - * @associates org.objectweb.asm.tree.TryCatchBlockNode + * @associates scala.tools.asm.tree.TryCatchBlockNode */ public List tryCatchBlocks; @@ -186,7 +186,7 @@ public class MethodNode extends MethodVisitor { * The local variables of this method. This list is a list of * {@link LocalVariableNode} objects. May be null * - * @associates org.objectweb.asm.tree.LocalVariableNode + * @associates scala.tools.asm.tree.LocalVariableNode */ public List localVariables; @@ -194,7 +194,7 @@ public class MethodNode extends MethodVisitor { * The visible local variable annotations of this method. This list is a * list of {@link LocalVariableAnnotationNode} objects. May be null * - * @associates org.objectweb.asm.tree.LocalVariableAnnotationNode + * @associates scala.tools.asm.tree.LocalVariableAnnotationNode */ public List visibleLocalVariableAnnotations; @@ -202,7 +202,7 @@ public class MethodNode extends MethodVisitor { * The invisible local variable annotations of this method. This list is a * list of {@link LocalVariableAnnotationNode} objects. May be null * - * @associates org.objectweb.asm.tree.LocalVariableAnnotationNode + * @associates scala.tools.asm.tree.LocalVariableAnnotationNode */ public List invisibleLocalVariableAnnotations; diff --git a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java index 7e2aa79..40b8e7c 100644 --- a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java @@ -42,7 +42,7 @@ public class MultiANewArrayInsnNode extends AbstractInsnNode { /** - * An array type descriptor (see {@link org.objectweb.asm.Type}). + * An array type descriptor (see {@link scala.tools.asm.Type}). */ public String desc; @@ -55,7 +55,7 @@ public class MultiANewArrayInsnNode extends AbstractInsnNode { * Constructs a new {@link MultiANewArrayInsnNode}. * * @param desc - * an array type descriptor (see {@link org.objectweb.asm.Type}). + * an array type descriptor (see {@link scala.tools.asm.Type}). * @param dims * number of dimensions of the array to allocate. */ diff --git a/src/main/java/scala/tools/asm/tree/ParameterNode.java b/src/main/java/scala/tools/asm/tree/ParameterNode.java index 5cb7ebc..cb5f798 100644 --- a/src/main/java/scala/tools/asm/tree/ParameterNode.java +++ b/src/main/java/scala/tools/asm/tree/ParameterNode.java @@ -43,7 +43,7 @@ public class ParameterNode { public String name; /** - * The parameter's access flags (see {@link org.objectweb.asm.Opcodes}). + * The parameter's access flags (see {@link scala.tools.asm.Opcodes}). * Valid values are ACC_FINAL, ACC_SYNTHETIC and * ACC_MANDATED. */ @@ -55,7 +55,7 @@ public class ParameterNode { * @param access * The parameter's access flags. Valid values are * ACC_FINAL, ACC_SYNTHETIC or/and - * ACC_MANDATED (see {@link org.objectweb.asm.Opcodes}). + * ACC_MANDATED (see {@link scala.tools.asm.Opcodes}). * @param name * the parameter's name. */ diff --git a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java index 5e64d14..0d172f4 100644 --- a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java +++ b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java @@ -66,7 +66,7 @@ public class TryCatchBlockNode { * list is a list of {@link TypeAnnotationNode} objects. May be * null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ public List visibleTypeAnnotations; @@ -76,7 +76,7 @@ public class TryCatchBlockNode { * This list is a list of {@link TypeAnnotationNode} objects. May be * null. * - * @associates org.objectweb.asm.tree.TypeAnnotationNode + * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ public List invisibleTypeAnnotations; diff --git a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java index cabe2b2..894f9c0 100644 --- a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java @@ -43,7 +43,7 @@ public class TypeInsnNode extends AbstractInsnNode { /** * The operand of this instruction. This operand is an internal name (see - * {@link org.objectweb.asm.Type}). + * {@link scala.tools.asm.Type}). */ public String desc; @@ -55,7 +55,7 @@ public class TypeInsnNode extends AbstractInsnNode { * opcode must be NEW, ANEWARRAY, CHECKCAST or INSTANCEOF. * @param desc * the operand of the instruction to be constructed. This operand - * is an internal name (see {@link org.objectweb.asm.Type}). + * is an internal name (see {@link scala.tools.asm.Type}). */ public TypeInsnNode(final int opcode, final String desc) { super(opcode); diff --git a/src/main/java/scala/tools/asm/util/ASMifiable.java b/src/main/java/scala/tools/asm/util/ASMifiable.java index 272d895..be4f569 100644 --- a/src/main/java/scala/tools/asm/util/ASMifiable.java +++ b/src/main/java/scala/tools/asm/util/ASMifiable.java @@ -34,7 +34,7 @@ import scala.tools.asm.Label; /** - * An {@link org.objectweb.asm.Attribute Attribute} that can print the ASM code + * An {@link scala.tools.asm.Attribute Attribute} that can print the ASM code * to create an equivalent attribute. * * @author Eugene Kuleshov diff --git a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java index da84a24..b182b50 100644 --- a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java @@ -60,7 +60,7 @@ * arguments - such as the fact that the given opcode is correct for a given * visit method. This adapter can also perform some basic data flow checks (more * precisely those that can be performed without the full class hierarchy - see - * {@link org.objectweb.asm.tree.analysis.BasicVerifier}). For instance in a + * {@link scala.tools.asm.tree.analysis.BasicVerifier}). For instance in a * method whose signature is void m (), the invalid instruction * IRETURN, or the invalid sequence IADD L2I will be detected if the data flow * checks are enabled. These checks are enabled by using the diff --git a/src/main/java/scala/tools/asm/util/Printer.java b/src/main/java/scala/tools/asm/util/Printer.java index 38d0845..22f8d6e 100644 --- a/src/main/java/scala/tools/asm/util/Printer.java +++ b/src/main/java/scala/tools/asm/util/Printer.java @@ -53,14 +53,14 @@ public abstract class Printer { /** * The names of the for operand parameter values of the - * {@link org.objectweb.asm.MethodVisitor#visitIntInsn} method when + * {@link scala.tools.asm.MethodVisitor#visitIntInsn} method when * opcode is NEWARRAY. */ public static final String[] TYPES; /** * The names of the tag field values for - * {@link org.objectweb.asm.Handle}. + * {@link scala.tools.asm.Handle}. */ public static final String[] HANDLE_TAG; @@ -155,7 +155,7 @@ protected Printer(final int api) { /** * Class header. - * See {@link org.objectweb.asm.ClassVisitor#visit}. + * See {@link scala.tools.asm.ClassVisitor#visit}. * * @param version * the class version. @@ -164,19 +164,19 @@ protected Printer(final int api) { * also indicates if the class is deprecated. * @param name * the internal name of the class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). * @param signature * the signature of this class. May be null if the class * is not a generic one, and does not extend or implement generic * classes or interfaces. * @param superName * the internal of name of the super class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). * For interfaces, the super class is {@link Object}. May be * null, but only for the {@link Object} class. * @param interfaces * the internal names of the class's interfaces (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). * May be null. */ public abstract void visit(final int version, final int access, @@ -185,7 +185,7 @@ public abstract void visit(final int version, final int access, /** * Class source. - * See {@link org.objectweb.asm.ClassVisitor#visitSource}. + * See {@link scala.tools.asm.ClassVisitor#visitSource}. * * @param source * the name of the source file from which the class was compiled. @@ -199,7 +199,7 @@ public abstract void visit(final int version, final int access, /** * Class outer class. - * See {@link org.objectweb.asm.ClassVisitor#visitOuterClass}. + * See {@link scala.tools.asm.ClassVisitor#visitOuterClass}. * * Visits the enclosing class of the class. This method must be called only * if the class has an enclosing class. @@ -220,7 +220,7 @@ public abstract void visitOuterClass(final String owner, final String name, /** * Class annotation. - * See {@link org.objectweb.asm.ClassVisitor#visitAnnotation}. + * See {@link scala.tools.asm.ClassVisitor#visitAnnotation}. * * @param desc * the class descriptor of the annotation class. @@ -233,15 +233,15 @@ public abstract Printer visitClassAnnotation(final String desc, /** * Class type annotation. - * See {@link org.objectweb.asm.ClassVisitor#visitTypeAnnotation}. + * See {@link scala.tools.asm.ClassVisitor#visitTypeAnnotation}. * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be - * {@link org.objectweb.asm.TypeReference#CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER}, - * {@link org.objectweb.asm.TypeReference#CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} - * or {@link org.objectweb.asm.TypeReference#CLASS_EXTENDS CLASS_EXTENDS}. - * See {@link org.objectweb.asm.TypeReference}. + * {@link scala.tools.asm.TypeReference#CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER}, + * {@link scala.tools.asm.TypeReference#CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} + * or {@link scala.tools.asm.TypeReference#CLASS_EXTENDS CLASS_EXTENDS}. + * See {@link scala.tools.asm.TypeReference}. * @param typePath * the path to the annotated type argument, wildcard bound, array * element type, or static inner type within 'typeRef'. May be @@ -259,7 +259,7 @@ public Printer visitClassTypeAnnotation(final int typeRef, /** * Class attribute. - * See {@link org.objectweb.asm.ClassVisitor#visitAttribute}. + * See {@link scala.tools.asm.ClassVisitor#visitAttribute}. * * @param attr * an attribute. @@ -268,14 +268,14 @@ public Printer visitClassTypeAnnotation(final int typeRef, /** * Class inner name. - * See {@link org.objectweb.asm.ClassVisitor#visitInnerClass}. + * See {@link scala.tools.asm.ClassVisitor#visitInnerClass}. * * @param name * the internal name of an inner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). * @param outerName * the internal name of the class to which the inner class - * belongs (see {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * belongs (see {@link scala.tools.asm.Type#getInternalName() getInternalName}). * May be null for not member classes. * @param innerName * the (simple) name of the inner class inside its enclosing @@ -289,7 +289,7 @@ public abstract void visitInnerClass(final String name, /** * Class field. - * See {@link org.objectweb.asm.ClassVisitor#visitField}. + * See {@link scala.tools.asm.ClassVisitor#visitField}. * * @param access * the field's access flags (see {@link Opcodes}). This parameter @@ -297,7 +297,7 @@ public abstract void visitInnerClass(final String name, * @param name * the field's name. * @param desc - * the field's descriptor (see {@link org.objectweb.asm.Type Type}). + * the field's descriptor (see {@link scala.tools.asm.Type Type}). * @param signature * the field's signature. May be null if the field's * type does not use generic types. @@ -318,7 +318,7 @@ public abstract Printer visitField(final int access, final String name, /** * Class method. - * See {@link org.objectweb.asm.ClassVisitor#visitMethod}. + * See {@link scala.tools.asm.ClassVisitor#visitMethod}. * * @param access * the method's access flags (see {@link Opcodes}). This @@ -327,14 +327,14 @@ public abstract Printer visitField(final int access, final String name, * @param name * the method's name. * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type Type}). + * the method's descriptor (see {@link scala.tools.asm.Type Type}). * @param signature * the method's signature. May be null if the method * parameters, return type and exceptions do not use generic * types. * @param exceptions * the internal names of the method's exception classes (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). May be + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). May be * null. * @return the printer */ @@ -342,7 +342,7 @@ public abstract Printer visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions); /** - * Class end. See {@link org.objectweb.asm.ClassVisitor#visitEnd}. + * Class end. See {@link scala.tools.asm.ClassVisitor#visitEnd}. */ public abstract void visitClassEnd(); @@ -352,7 +352,7 @@ public abstract Printer visitMethod(final int access, final String name, /** * Annotation value. - * See {@link org.objectweb.asm.AnnotationVisitor#visit}. + * See {@link scala.tools.asm.AnnotationVisitor#visit}. * * @param name * the value name. @@ -360,7 +360,7 @@ public abstract Printer visitMethod(final int access, final String name, * the actual value, whose type must be {@link Byte}, * {@link Boolean}, {@link Character}, {@link Short}, * {@link Integer} , {@link Long}, {@link Float}, {@link Double}, - * {@link String} or {@link org.objectweb.asm.Type} + * {@link String} or {@link scala.tools.asm.Type} * or OBJECT or ARRAY sort. * This value can also be an array of byte, boolean, short, char, int, * long, float or double values (this is equivalent to using @@ -371,7 +371,7 @@ public abstract Printer visitMethod(final int access, final String name, /** * Annotation enum value. - * See {@link org.objectweb.asm.AnnotationVisitor#visitEnum}. + * See {@link scala.tools.asm.AnnotationVisitor#visitEnum}. * * Visits an enumeration value of the annotation. * @@ -387,7 +387,7 @@ public abstract void visitEnum(final String name, final String desc, /** * Nested annotation value. - * See {@link org.objectweb.asm.AnnotationVisitor#visitAnnotation}. + * See {@link scala.tools.asm.AnnotationVisitor#visitAnnotation}. * * @param name * the value name. @@ -399,12 +399,12 @@ public abstract void visitEnum(final String name, final String desc, /** * Annotation array value. - * See {@link org.objectweb.asm.AnnotationVisitor#visitArray}. + * See {@link scala.tools.asm.AnnotationVisitor#visitArray}. * * Visits an array value of the annotation. Note that arrays of primitive * types (such as byte, boolean, short, char, int, long, float or double) * can be passed as value to {@link #visit visit}. This is what - * {@link org.objectweb.asm.ClassReader} does. + * {@link scala.tools.asm.ClassReader} does. * * @param name * the value name. @@ -413,7 +413,7 @@ public abstract void visitEnum(final String name, final String desc, public abstract Printer visitArray(final String name); /** - * Annotation end. See {@link org.objectweb.asm.AnnotationVisitor#visitEnd}. + * Annotation end. See {@link scala.tools.asm.AnnotationVisitor#visitEnd}. */ public abstract void visitAnnotationEnd(); @@ -423,7 +423,7 @@ public abstract void visitEnum(final String name, final String desc, /** * Field annotation. - * See {@link org.objectweb.asm.FieldVisitor#visitAnnotation}. + * See {@link scala.tools.asm.FieldVisitor#visitAnnotation}. * * @param desc * the class descriptor of the annotation class. @@ -436,12 +436,12 @@ public abstract Printer visitFieldAnnotation(final String desc, /** * Field type annotation. - * See {@link org.objectweb.asm.FieldVisitor#visitTypeAnnotation}. + * See {@link scala.tools.asm.FieldVisitor#visitTypeAnnotation}. * * @param typeRef * a reference to the annotated type. The sort of this type - * reference must be {@link org.objectweb.asm.TypeReference#FIELD FIELD}. - * See {@link org.objectweb.asm.TypeReference}. + * reference must be {@link scala.tools.asm.TypeReference#FIELD FIELD}. + * See {@link scala.tools.asm.TypeReference}. * @param typePath * the path to the annotated type argument, wildcard bound, array * element type, or static inner type within 'typeRef'. May be @@ -459,7 +459,7 @@ public Printer visitFieldTypeAnnotation(final int typeRef, /** * Field attribute. - * See {@link org.objectweb.asm.FieldVisitor#visitAttribute}. + * See {@link scala.tools.asm.FieldVisitor#visitAttribute}. * * @param attr * an attribute. @@ -468,7 +468,7 @@ public Printer visitFieldTypeAnnotation(final int typeRef, /** * Field end. - * See {@link org.objectweb.asm.FieldVisitor#visitEnd}. + * See {@link scala.tools.asm.FieldVisitor#visitEnd}. */ public abstract void visitFieldEnd(); @@ -478,7 +478,7 @@ public Printer visitFieldTypeAnnotation(final int typeRef, /** * Method parameter. - * See {@link org.objectweb.asm.MethodVisitor#visitParameter(String, int)}. + * See {@link scala.tools.asm.MethodVisitor#visitParameter(String, int)}. * * @param name * parameter name or null if none is provided. @@ -493,7 +493,7 @@ public void visitParameter(String name, int access) { /** * Method default annotation. - * See {@link org.objectweb.asm.MethodVisitor#visitAnnotationDefault}. + * See {@link scala.tools.asm.MethodVisitor#visitAnnotationDefault}. * * @return the printer */ @@ -501,7 +501,7 @@ public void visitParameter(String name, int access) { /** * Method annotation. - * See {@link org.objectweb.asm.MethodVisitor#visitAnnotation}. + * See {@link scala.tools.asm.MethodVisitor#visitAnnotation}. * * @param desc * the class descriptor of the annotation class. @@ -514,12 +514,12 @@ public abstract Printer visitMethodAnnotation(final String desc, /** * Method type annotation. - * See {@link org.objectweb.asm.MethodVisitor#visitTypeAnnotation}. + * See {@link scala.tools.asm.MethodVisitor#visitTypeAnnotation}. * * @param typeRef * a reference to the annotated type. The sort of this type - * reference must be {@link org.objectweb.asm.TypeReference#FIELD FIELD}. - * See {@link org.objectweb.asm.TypeReference}. + * reference must be {@link scala.tools.asm.TypeReference#FIELD FIELD}. + * See {@link scala.tools.asm.TypeReference}. * @param typePath * the path to the annotated type argument, wildcard bound, array * element type, or static inner type within 'typeRef'. May be @@ -537,7 +537,7 @@ public Printer visitMethodTypeAnnotation(final int typeRef, /** * Method parameter annotation. - * See {@link org.objectweb.asm.MethodVisitor#visitParameterAnnotation}. + * See {@link scala.tools.asm.MethodVisitor#visitParameterAnnotation}. * * @param parameter * the parameter index. @@ -552,7 +552,7 @@ public abstract Printer visitParameterAnnotation(final int parameter, /** * Method attribute. - * See {@link org.objectweb.asm.MethodVisitor#visitAttribute}. + * See {@link scala.tools.asm.MethodVisitor#visitAttribute}. * * @param attr * an attribute. @@ -561,13 +561,13 @@ public abstract Printer visitParameterAnnotation(final int parameter, /** * Method start. - * See {@link org.objectweb.asm.MethodVisitor#visitCode}. + * See {@link scala.tools.asm.MethodVisitor#visitCode}. */ public abstract void visitCode(); /** * Method stack frame. - * See {@link org.objectweb.asm.MethodVisitor#visitFrame}. + * See {@link scala.tools.asm.MethodVisitor#visitFrame}. * * Visits the current state of the local variables and operand stack * elements. This method must(*) be called just before any @@ -648,7 +648,7 @@ public abstract void visitFrame(final int type, final int nLocal, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitInsn} + * See {@link scala.tools.asm.MethodVisitor#visitInsn} * * @param opcode * the opcode of the instruction to be visited. This opcode is @@ -671,7 +671,7 @@ public abstract void visitFrame(final int type, final int nLocal, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitIntInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitIntInsn}. * * @param opcode * the opcode of the instruction to be visited. This opcode is @@ -692,7 +692,7 @@ public abstract void visitFrame(final int type, final int nLocal, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitVarInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitVarInsn}. * * @param opcode * the opcode of the local variable instruction to be visited. @@ -706,7 +706,7 @@ public abstract void visitFrame(final int type, final int nLocal, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitTypeInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitTypeInsn}. * /** * Visits a type instruction. A type instruction is an instruction that @@ -718,31 +718,31 @@ public abstract void visitFrame(final int type, final int nLocal, * @param type * the operand of the instruction to be visited. This operand * must be the internal name of an object or array class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). */ public abstract void visitTypeInsn(final int opcode, final String type); /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitFieldInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitFieldInsn}. * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. * @param owner * the internal name of the field's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). * @param name * the field's name. * @param desc - * the field's descriptor (see {@link org.objectweb.asm.Type Type}). + * the field's descriptor (see {@link scala.tools.asm.Type Type}). */ public abstract void visitFieldInsn(final int opcode, final String owner, final String name, final String desc); /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitMethodInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitMethodInsn}. * * @param opcode * the opcode of the type instruction to be visited. This opcode @@ -750,11 +750,11 @@ public abstract void visitFieldInsn(final int opcode, final String owner, * INVOKEINTERFACE. * @param owner * the internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). * @param name * the method's name. * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type Type}). + * the method's descriptor (see {@link scala.tools.asm.Type Type}). */ @Deprecated public void visitMethodInsn(final int opcode, final String owner, @@ -769,7 +769,7 @@ public void visitMethodInsn(final int opcode, final String owner, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitMethodInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitMethodInsn}. * * @param opcode * the opcode of the type instruction to be visited. This opcode @@ -777,11 +777,11 @@ public void visitMethodInsn(final int opcode, final String owner, * INVOKEINTERFACE. * @param owner * the internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). + * {@link scala.tools.asm.Type#getInternalName() getInternalName}). * @param name * the method's name. * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type Type}). + * the method's descriptor (see {@link scala.tools.asm.Type Type}). * @param itf * if the method's owner class is an interface. */ @@ -800,20 +800,20 @@ public void visitMethodInsn(final int opcode, final String owner, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitInvokeDynamicInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitInvokeDynamicInsn}. * * Visits an invokedynamic instruction. * * @param name * the method's name. * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type Type}). + * the method's descriptor (see {@link scala.tools.asm.Type Type}). * @param bsm * the bootstrap method. * @param bsmArgs * the bootstrap method constant arguments. Each argument must be * an {@link Integer}, {@link Float}, {@link Long}, - * {@link Double}, {@link String}, {@link org.objectweb.asm.Type} or {@link Handle} + * {@link Double}, {@link String}, {@link scala.tools.asm.Type} or {@link Handle} * value. This method is allowed to modify the content of the * array so a caller should expect that this array may change. */ @@ -822,7 +822,7 @@ public abstract void visitInvokeDynamicInsn(String name, String desc, /** * Method jump instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitJumpInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitJumpInsn}. * * @param opcode * the opcode of the type instruction to be visited. This opcode @@ -838,7 +838,7 @@ public abstract void visitInvokeDynamicInsn(String name, String desc, /** * Method label. - * See {@link org.objectweb.asm.MethodVisitor#visitLabel}. + * See {@link scala.tools.asm.MethodVisitor#visitLabel}. * * @param label * a {@link Label Label} object. @@ -847,7 +847,7 @@ public abstract void visitInvokeDynamicInsn(String name, String desc, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitLdcInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitLdcInsn}. * * Visits a LDC instruction. Note that new constant types may be added in * future versions of the Java Virtual Machine. To easily detect new @@ -886,9 +886,9 @@ public abstract void visitInvokeDynamicInsn(String name, String desc, * @param cst * the constant to be loaded on the stack. This parameter must be * a non null {@link Integer}, a {@link Float}, a {@link Long}, a - * {@link Double}, a {@link String}, a {@link org.objectweb.asm.Type} + * {@link Double}, a {@link String}, a {@link scala.tools.asm.Type} * of OBJECT or ARRAY sort for .class constants, for classes whose - * version is 49.0, a {@link org.objectweb.asm.Type} of METHOD sort or a + * version is 49.0, a {@link scala.tools.asm.Type} of METHOD sort or a * {@link Handle} for MethodType and MethodHandle constants, for * classes whose version is 51.0. */ @@ -896,7 +896,7 @@ public abstract void visitInvokeDynamicInsn(String name, String desc, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitIincInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitIincInsn}. * * @param var * index of the local variable to be incremented. @@ -907,7 +907,7 @@ public abstract void visitInvokeDynamicInsn(String name, String desc, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitTableSwitchInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitTableSwitchInsn}. * * @param min * the minimum key value. @@ -924,7 +924,7 @@ public abstract void visitTableSwitchInsn(final int min, final int max, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitLookupSwitchInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitLookupSwitchInsn}. * * @param dflt * beginning of the default handler block. @@ -939,10 +939,10 @@ public abstract void visitLookupSwitchInsn(final Label dflt, /** * Method instruction. - * See {@link org.objectweb.asm.MethodVisitor#visitMultiANewArrayInsn}. + * See {@link scala.tools.asm.MethodVisitor#visitMultiANewArrayInsn}. * * @param desc - * an array type descriptor (see {@link org.objectweb.asm.Type Type}). + * an array type descriptor (see {@link scala.tools.asm.Type Type}). * @param dims * number of dimensions of the array to allocate. */ @@ -951,20 +951,20 @@ public abstract void visitMultiANewArrayInsn(final String desc, /** * Instruction type annotation. - * See {@link org.objectweb.asm.MethodVisitor#visitInsnAnnotation}. + * See {@link scala.tools.asm.MethodVisitor#visitInsnAnnotation}. * * @param typeRef * a reference to the annotated type. The sort of this type - * reference must be {@link org.objectweb.asm.TypeReference#INSTANCEOF INSTANCEOF}, - * {@link org.objectweb.asm.TypeReference#NEW NEW}, - * {@link org.objectweb.asm.TypeReference#CONSTRUCTOR_REFERENCE CONSTRUCTOR_REFERENCE}, - * {@link org.objectweb.asm.TypeReference#METHOD_REFERENCE METHOD_REFERENCE}, - * {@link org.objectweb.asm.TypeReference#CAST CAST}, - * {@link org.objectweb.asm.TypeReference#CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}, - * {@link org.objectweb.asm.TypeReference#METHOD_INVOCATION_TYPE_ARGUMENT METHOD_INVOCATION_TYPE_ARGUMENT}, - * {@link org.objectweb.asm.TypeReference#CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, - * or {@link org.objectweb.asm.TypeReference#METHOD_REFERENCE_TYPE_ARGUMENT METHOD_REFERENCE_TYPE_ARGUMENT}. - * See {@link org.objectweb.asm.TypeReference}. + * reference must be {@link scala.tools.asm.TypeReference#INSTANCEOF INSTANCEOF}, + * {@link scala.tools.asm.TypeReference#NEW NEW}, + * {@link scala.tools.asm.TypeReference#CONSTRUCTOR_REFERENCE CONSTRUCTOR_REFERENCE}, + * {@link scala.tools.asm.TypeReference#METHOD_REFERENCE METHOD_REFERENCE}, + * {@link scala.tools.asm.TypeReference#CAST CAST}, + * {@link scala.tools.asm.TypeReference#CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT}, + * {@link scala.tools.asm.TypeReference#METHOD_INVOCATION_TYPE_ARGUMENT METHOD_INVOCATION_TYPE_ARGUMENT}, + * {@link scala.tools.asm.TypeReference#CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, + * or {@link scala.tools.asm.TypeReference#METHOD_REFERENCE_TYPE_ARGUMENT METHOD_REFERENCE_TYPE_ARGUMENT}. + * See {@link scala.tools.asm.TypeReference}. * @param typePath * the path to the annotated type argument, wildcard bound, array * element type, or static inner type within 'typeRef'. May be @@ -982,7 +982,7 @@ public Printer visitInsnAnnotation(final int typeRef, /** * Method exception handler. - * See {@link org.objectweb.asm.MethodVisitor#visitTryCatchBlock}. + * See {@link scala.tools.asm.MethodVisitor#visitTryCatchBlock}. * * @param start * beginning of the exception handler's scope (inclusive). @@ -1003,13 +1003,13 @@ public abstract void visitTryCatchBlock(final Label start, final Label end, /** * Try catch block type annotation. - * See {@link org.objectweb.asm.MethodVisitor#visitTryCatchAnnotation}. + * See {@link scala.tools.asm.MethodVisitor#visitTryCatchAnnotation}. * * @param typeRef * a reference to the annotated type. The sort of this type - * reference must be {@link org.objectweb.asm.TypeReference#EXCEPTION_PARAMETER + * reference must be {@link scala.tools.asm.TypeReference#EXCEPTION_PARAMETER * EXCEPTION_PARAMETER}. - * See {@link org.objectweb.asm.TypeReference}. + * See {@link scala.tools.asm.TypeReference}. * @param typePath * the path to the annotated type argument, wildcard bound, array * element type, or static inner type within 'typeRef'. May be @@ -1027,7 +1027,7 @@ public Printer visitTryCatchAnnotation(final int typeRef, /** * Method debug info. - * See {@link org.objectweb.asm.MethodVisitor#visitLocalVariable}. + * See {@link scala.tools.asm.MethodVisitor#visitLocalVariable}. * * @param name * the name of a local variable. @@ -1055,14 +1055,14 @@ public abstract void visitLocalVariable(final String name, /** * Local variable type annotation. - * See {@link org.objectweb.asm.MethodVisitor#visitTryCatchAnnotation}. + * See {@link scala.tools.asm.MethodVisitor#visitTryCatchAnnotation}. * * @param typeRef * a reference to the annotated type. The sort of this type - * reference must be {@link org.objectweb.asm.TypeReference#LOCAL_VARIABLE - * LOCAL_VARIABLE} or {@link org.objectweb.asm.TypeReference#RESOURCE_VARIABLE + * reference must be {@link scala.tools.asm.TypeReference#LOCAL_VARIABLE + * LOCAL_VARIABLE} or {@link scala.tools.asm.TypeReference#RESOURCE_VARIABLE * RESOURCE_VARIABLE}. - * See {@link org.objectweb.asm.TypeReference}. + * See {@link scala.tools.asm.TypeReference}. * @param typePath * the path to the annotated type argument, wildcard bound, array * element type, or static inner type within 'typeRef'. May be @@ -1091,7 +1091,7 @@ public Printer visitLocalVariableAnnotation(final int typeRef, /** * Method debug info. - * See {@link org.objectweb.asm.MethodVisitor#visitLineNumber}. + * See {@link scala.tools.asm.MethodVisitor#visitLineNumber}. * * @param line * a line number. This number refers to the source file from @@ -1106,7 +1106,7 @@ public Printer visitLocalVariableAnnotation(final int typeRef, /** * Method max stack and max locals. - * See {@link org.objectweb.asm.MethodVisitor#visitMaxs}. + * See {@link scala.tools.asm.MethodVisitor#visitMaxs}. * * @param maxStack * maximum stack size of the method. @@ -1117,7 +1117,7 @@ public Printer visitLocalVariableAnnotation(final int typeRef, /** * Method end. - * See {@link org.objectweb.asm.MethodVisitor#visitEnd}. + * See {@link scala.tools.asm.MethodVisitor#visitEnd}. */ public abstract void visitMethodEnd(); diff --git a/src/main/java/scala/tools/asm/util/Textifiable.java b/src/main/java/scala/tools/asm/util/Textifiable.java index 250bce4..9b168ca 100644 --- a/src/main/java/scala/tools/asm/util/Textifiable.java +++ b/src/main/java/scala/tools/asm/util/Textifiable.java @@ -34,7 +34,7 @@ import scala.tools.asm.Label; /** - * An {@link org.objectweb.asm.Attribute Attribute} that can print a readable + * An {@link scala.tools.asm.Attribute Attribute} that can print a readable * representation of itself. * * Implementations should construct readable output from an attribute data From e8885eb176e8e06ef7be49b31f7e5d8131f1dc61 Mon Sep 17 00:00:00 2001 From: Carsten Varming Date: Mon, 18 Jul 2016 13:12:34 -0400 Subject: [PATCH 05/17] remove trailing whitespace --- .../scala/tools/asm/AnnotationVisitor.java | 14 +-- .../scala/tools/asm/AnnotationWriter.java | 12 +-- src/main/java/scala/tools/asm/Attribute.java | 20 ++--- src/main/java/scala/tools/asm/ByteVector.java | 24 ++--- .../java/scala/tools/asm/ClassReader.java | 88 +++++++++---------- .../java/scala/tools/asm/ClassVisitor.java | 24 ++--- .../java/scala/tools/asm/ClassWriter.java | 86 +++++++++--------- src/main/java/scala/tools/asm/Context.java | 2 +- src/main/java/scala/tools/asm/Edge.java | 2 +- .../java/scala/tools/asm/FieldVisitor.java | 12 +-- .../java/scala/tools/asm/FieldWriter.java | 8 +- src/main/java/scala/tools/asm/Frame.java | 48 +++++----- src/main/java/scala/tools/asm/Handle.java | 30 +++---- src/main/java/scala/tools/asm/Handler.java | 4 +- src/main/java/scala/tools/asm/Item.java | 26 +++--- src/main/java/scala/tools/asm/Label.java | 38 ++++---- .../java/scala/tools/asm/MethodVisitor.java | 66 +++++++------- .../java/scala/tools/asm/MethodWriter.java | 44 +++++----- src/main/java/scala/tools/asm/Opcodes.java | 2 +- src/main/java/scala/tools/asm/Type.java | 72 +++++++-------- src/main/java/scala/tools/asm/TypePath.java | 12 +-- .../java/scala/tools/asm/TypeReference.java | 46 +++++----- .../tools/asm/commons/CodeSizeEvaluator.java | 2 +- .../tools/asm/signature/SignatureReader.java | 10 +-- .../tools/asm/signature/SignatureVisitor.java | 32 +++---- .../tools/asm/signature/SignatureWriter.java | 4 +- .../tools/asm/tree/AbstractInsnNode.java | 28 +++--- .../scala/tools/asm/tree/AnnotationNode.java | 14 +-- .../java/scala/tools/asm/tree/ClassNode.java | 26 +++--- .../scala/tools/asm/tree/FieldInsnNode.java | 6 +- .../java/scala/tools/asm/tree/FieldNode.java | 20 ++--- .../java/scala/tools/asm/tree/FrameNode.java | 6 +- .../scala/tools/asm/tree/IincInsnNode.java | 4 +- .../scala/tools/asm/tree/InnerClassNode.java | 6 +- .../java/scala/tools/asm/tree/InsnList.java | 46 +++++----- .../java/scala/tools/asm/tree/InsnNode.java | 6 +- .../scala/tools/asm/tree/IntInsnNode.java | 6 +- .../tools/asm/tree/InvokeDynamicInsnNode.java | 4 +- .../scala/tools/asm/tree/JumpInsnNode.java | 6 +- .../scala/tools/asm/tree/LdcInsnNode.java | 4 +- .../scala/tools/asm/tree/LineNumberNode.java | 4 +- .../asm/tree/LocalVariableAnnotationNode.java | 8 +- .../tools/asm/tree/LocalVariableNode.java | 6 +- .../tools/asm/tree/LookupSwitchInsnNode.java | 4 +- .../scala/tools/asm/tree/MethodInsnNode.java | 8 +- .../java/scala/tools/asm/tree/MethodNode.java | 42 ++++----- .../asm/tree/MultiANewArrayInsnNode.java | 4 +- .../scala/tools/asm/tree/ParameterNode.java | 6 +- .../tools/asm/tree/TableSwitchInsnNode.java | 4 +- .../tools/asm/tree/TryCatchBlockNode.java | 12 +-- .../tools/asm/tree/TypeAnnotationNode.java | 6 +- .../scala/tools/asm/tree/TypeInsnNode.java | 6 +- .../scala/tools/asm/tree/VarInsnNode.java | 6 +- .../tools/asm/tree/analysis/Analyzer.java | 24 ++--- .../asm/tree/analysis/AnalyzerException.java | 2 +- .../asm/tree/analysis/BasicInterpreter.java | 2 +- .../tools/asm/tree/analysis/BasicValue.java | 2 +- .../asm/tree/analysis/BasicVerifier.java | 2 +- .../scala/tools/asm/tree/analysis/Frame.java | 36 ++++---- .../tools/asm/tree/analysis/Interpreter.java | 38 ++++---- .../asm/tree/analysis/SimpleVerifier.java | 8 +- .../tools/asm/tree/analysis/SmallSet.java | 2 +- .../asm/tree/analysis/SourceInterpreter.java | 2 +- .../tools/asm/tree/analysis/SourceValue.java | 6 +- .../tools/asm/tree/analysis/Subroutine.java | 2 +- .../scala/tools/asm/tree/analysis/Value.java | 4 +- .../java/scala/tools/asm/util/ASMifiable.java | 4 +- .../java/scala/tools/asm/util/ASMifier.java | 20 ++--- .../asm/util/CheckAnnotationAdapter.java | 2 +- .../tools/asm/util/CheckClassAdapter.java | 66 +++++++------- .../tools/asm/util/CheckFieldAdapter.java | 4 +- .../tools/asm/util/CheckMethodAdapter.java | 48 +++++----- .../tools/asm/util/CheckSignatureAdapter.java | 6 +- .../java/scala/tools/asm/util/Printer.java | 10 +-- .../scala/tools/asm/util/Textifiable.java | 6 +- .../asm/util/TraceAnnotationVisitor.java | 2 +- .../tools/asm/util/TraceClassVisitor.java | 24 ++--- .../tools/asm/util/TraceFieldVisitor.java | 2 +- .../tools/asm/util/TraceMethodVisitor.java | 2 +- .../tools/asm/util/TraceSignatureVisitor.java | 2 +- 80 files changed, 677 insertions(+), 677 deletions(-) diff --git a/src/main/java/scala/tools/asm/AnnotationVisitor.java b/src/main/java/scala/tools/asm/AnnotationVisitor.java index b7b5476..abcaf1d 100644 --- a/src/main/java/scala/tools/asm/AnnotationVisitor.java +++ b/src/main/java/scala/tools/asm/AnnotationVisitor.java @@ -33,7 +33,7 @@ * A visitor to visit a Java annotation. The methods of this class must be * called in the following order: ( visit | visitEnum | * visitAnnotation | visitArray )* visitEnd. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -53,7 +53,7 @@ public abstract class AnnotationVisitor { /** * Constructs a new {@link AnnotationVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -64,7 +64,7 @@ public AnnotationVisitor(final int api) { /** * Constructs a new {@link AnnotationVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -82,7 +82,7 @@ public AnnotationVisitor(final int api, final AnnotationVisitor av) { /** * Visits a primitive value of the annotation. - * + * * @param name * the value name. * @param value @@ -103,7 +103,7 @@ public void visit(String name, Object value) { /** * Visits an enumeration value of the annotation. - * + * * @param name * the value name. * @param desc @@ -119,7 +119,7 @@ public void visitEnum(String name, String desc, String value) { /** * Visits a nested annotation value of the annotation. - * + * * @param name * the value name. * @param desc @@ -142,7 +142,7 @@ public AnnotationVisitor visitAnnotation(String name, String desc) { * types (such as byte, boolean, short, char, int, long, float or double) * can be passed as value to {@link #visit visit}. This is what * {@link ClassReader} does. - * + * * @param name * the value name. * @return a visitor to visit the actual array value elements, or diff --git a/src/main/java/scala/tools/asm/AnnotationWriter.java b/src/main/java/scala/tools/asm/AnnotationWriter.java index 16014f5..6de74ce 100644 --- a/src/main/java/scala/tools/asm/AnnotationWriter.java +++ b/src/main/java/scala/tools/asm/AnnotationWriter.java @@ -31,7 +31,7 @@ /** * An {@link AnnotationVisitor} that generates annotations in bytecode form. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -89,7 +89,7 @@ final class AnnotationWriter extends AnnotationVisitor { /** * Constructs a new {@link AnnotationWriter}. - * + * * @param cw * the class writer to which this annotation must be added. * @param named @@ -237,7 +237,7 @@ public void visitEnd() { /** * Returns the size of this annotation writer list. - * + * * @return the size of this annotation writer list. */ int getSize() { @@ -253,7 +253,7 @@ int getSize() { /** * Puts the annotations of this annotation writer list into the given byte * vector. - * + * * @param out * where the annotations must be put. */ @@ -281,7 +281,7 @@ void put(final ByteVector out) { /** * Puts the given annotation lists into the given byte vector. - * + * * @param panns * an array of annotation writer lists. * @param off @@ -319,7 +319,7 @@ static void put(final AnnotationWriter[] panns, final int off, /** * Puts the given type reference and type path into the given bytevector. * LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported. - * + * * @param typeRef * a reference to the annotated type. See {@link TypeReference}. * @param typePath diff --git a/src/main/java/scala/tools/asm/Attribute.java b/src/main/java/scala/tools/asm/Attribute.java index 8d72a2c..ac40a75 100644 --- a/src/main/java/scala/tools/asm/Attribute.java +++ b/src/main/java/scala/tools/asm/Attribute.java @@ -31,7 +31,7 @@ /** * A non standard class, field, method or code attribute. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -54,7 +54,7 @@ public class Attribute { /** * Constructs a new empty attribute. - * + * * @param type * the type of the attribute. */ @@ -65,7 +65,7 @@ protected Attribute(final String type) { /** * Returns true if this type of attribute is unknown. The default * implementation of this method always returns true. - * + * * @return true if this type of attribute is unknown. */ public boolean isUnknown() { @@ -74,7 +74,7 @@ public boolean isUnknown() { /** * Returns true if this type of attribute is a code attribute. - * + * * @return true if this type of attribute is a code attribute. */ public boolean isCodeAttribute() { @@ -83,7 +83,7 @@ public boolean isCodeAttribute() { /** * Returns the labels corresponding to this attribute. - * + * * @return the labels corresponding to this attribute, or null if * this attribute is not a code attribute that contains labels. */ @@ -96,7 +96,7 @@ protected Label[] getLabels() { * new {@link Attribute} object, of type {@link #type type}, * corresponding to the len bytes starting at the given offset, in * the given class reader. - * + * * @param cr * the class that contains the attribute to be read. * @param off @@ -133,7 +133,7 @@ protected Attribute read(final ClassReader cr, final int off, /** * Returns the byte array form of this attribute. - * + * * @param cw * the class to which this attribute must be added. This * parameter can be used to add to the constant pool of this @@ -166,7 +166,7 @@ protected ByteVector write(final ClassWriter cw, final byte[] code, /** * Returns the length of the attribute list that begins with this attribute. - * + * * @return the length of the attribute list that begins with this attribute. */ final int getCount() { @@ -181,7 +181,7 @@ final int getCount() { /** * Returns the size of all the attributes in this attribute list. - * + * * @param cw * the class writer to be used to convert the attributes into * byte arrays, with the {@link #write write} method. @@ -219,7 +219,7 @@ final int getSize(final ClassWriter cw, final byte[] code, final int len, /** * Writes all the attributes of this attribute list in the given byte * vector. - * + * * @param cw * the class writer to be used to convert the attributes into * byte arrays, with the {@link #write write} method. diff --git a/src/main/java/scala/tools/asm/ByteVector.java b/src/main/java/scala/tools/asm/ByteVector.java index 284468e..3bca7af 100644 --- a/src/main/java/scala/tools/asm/ByteVector.java +++ b/src/main/java/scala/tools/asm/ByteVector.java @@ -32,7 +32,7 @@ /** * A dynamically extensible vector of bytes. This class is roughly equivalent to * a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient. - * + * * @author Eric Bruneton */ public class ByteVector { @@ -58,7 +58,7 @@ public ByteVector() { /** * Constructs a new {@link ByteVector ByteVector} with the given initial * size. - * + * * @param initialSize * the initial size of the byte vector to be constructed. */ @@ -69,7 +69,7 @@ public ByteVector(final int initialSize) { /** * Puts a byte into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param b * a byte. * @return this byte vector. @@ -87,7 +87,7 @@ public ByteVector putByte(final int b) { /** * Puts two bytes into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param b1 * a byte. * @param b2 @@ -109,7 +109,7 @@ ByteVector put11(final int b1, final int b2) { /** * Puts a short into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param s * a short. * @return this byte vector. @@ -129,7 +129,7 @@ public ByteVector putShort(final int s) { /** * Puts a byte and a short into this byte vector. The byte vector is * automatically enlarged if necessary. - * + * * @param b * a byte. * @param s @@ -152,7 +152,7 @@ ByteVector put12(final int b, final int s) { /** * Puts an int into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param i * an int. * @return this byte vector. @@ -174,7 +174,7 @@ public ByteVector putInt(final int i) { /** * Puts a long into this byte vector. The byte vector is automatically * enlarged if necessary. - * + * * @param l * a long. * @return this byte vector. @@ -202,7 +202,7 @@ public ByteVector putLong(final long l) { /** * Puts an UTF8 string into this byte vector. The byte vector is * automatically enlarged if necessary. - * + * * @param s * a String whose UTF8 encoded length must be less than 65536. * @return this byte vector. @@ -243,7 +243,7 @@ public ByteVector putUTF8(final String s) { * automatically enlarged if necessary. The string length is encoded in two * bytes before the encoded characters, if there is space for that (i.e. if * this.length - i - 2 >= 0). - * + * * @param s * the String to encode. * @param i @@ -301,7 +301,7 @@ ByteVector encodeUTF8(final String s, int i, int maxByteLength) { /** * Puts an array of bytes into this byte vector. The byte vector is * automatically enlarged if necessary. - * + * * @param b * an array of bytes. May be null to put len * null bytes into this byte vector. @@ -324,7 +324,7 @@ public ByteVector putByteArray(final byte[] b, final int off, final int len) { /** * Enlarge this byte vector so that it can receive n more bytes. - * + * * @param size * number of additional bytes that this byte vector should be * able to receive. diff --git a/src/main/java/scala/tools/asm/ClassReader.java b/src/main/java/scala/tools/asm/ClassReader.java index 85e27f9..e3acb31 100644 --- a/src/main/java/scala/tools/asm/ClassReader.java +++ b/src/main/java/scala/tools/asm/ClassReader.java @@ -37,7 +37,7 @@ * This class parses a byte array conforming to the Java class file format and * calls the appropriate visit methods of a given class visitor for each field, * method and bytecode instruction encountered. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -145,7 +145,7 @@ public class ClassReader { /** * Constructs a new {@link ClassReader} object. - * + * * @param b * the bytecode of the class to be read. */ @@ -155,7 +155,7 @@ public ClassReader(final byte[] b) { /** * Constructs a new {@link ClassReader} object. - * + * * @param b * the bytecode of the class to be read. * @param off @@ -220,9 +220,9 @@ public ClassReader(final byte[] b, final int off, final int len) { * Returns the class's access flags (see {@link Opcodes}). This value may * not reflect Deprecated and Synthetic flags when bytecode is before 1.5 * and those flags are represented by attributes. - * + * * @return the class access flags - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public int getAccess() { @@ -232,9 +232,9 @@ public int getAccess() { /** * Returns the internal name of the class (see * {@link Type#getInternalName() getInternalName}). - * + * * @return the internal class name - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public String getClassName() { @@ -245,10 +245,10 @@ public String getClassName() { * Returns the internal of name of the super class (see * {@link Type#getInternalName() getInternalName}). For interfaces, the * super class is {@link Object}. - * + * * @return the internal name of super class, or null for * {@link Object} class. - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public String getSuperName() { @@ -258,10 +258,10 @@ public String getSuperName() { /** * Returns the internal names of the class's interfaces (see * {@link Type#getInternalName() getInternalName}). - * + * * @return the array of internal names for all implemented interfaces or * null. - * + * * @see ClassVisitor#visit(int, int, String, String, String, String[]) */ public String[] getInterfaces() { @@ -281,7 +281,7 @@ public String[] getInterfaces() { /** * Copies the constant pool data into the given {@link ClassWriter}. Should * be called before the {@link #accept(ClassVisitor,int)} method. - * + * * @param classWriter * the {@link ClassWriter} to copy constant pool into. */ @@ -369,7 +369,7 @@ void copyPool(final ClassWriter classWriter) { /** * Copies the bootstrap method data into the given {@link ClassWriter}. * Should be called before the {@link #accept(ClassVisitor,int)} method. - * + * * @param classWriter * the {@link ClassWriter} to copy bootstrap methods into. */ @@ -414,7 +414,7 @@ private void copyBootstrapMethods(final ClassWriter classWriter, /** * Constructs a new {@link ClassReader} object. - * + * * @param is * an input stream from which to read the class. * @throws IOException @@ -426,7 +426,7 @@ public ClassReader(final InputStream is) throws IOException { /** * Constructs a new {@link ClassReader} object. - * + * * @param name * the binary qualified name of the class to be read. * @throws IOException @@ -440,7 +440,7 @@ public ClassReader(final String name) throws IOException { /** * Reads the bytecode of a class. - * + * * @param is * an input stream from which to read the class. * @param close @@ -494,7 +494,7 @@ private static byte[] readClass(final InputStream is, boolean close) * Makes the given visitor visit the Java class of this {@link ClassReader} * . This class is the one specified in the constructor (see * {@link #ClassReader(byte[]) ClassReader}). - * + * * @param classVisitor * the visitor that must visit this class. * @param flags @@ -510,7 +510,7 @@ public void accept(final ClassVisitor classVisitor, final int flags) { * Makes the given visitor visit the Java class of this {@link ClassReader}. * This class is the one specified in the constructor (see * {@link #ClassReader(byte[]) ClassReader}). - * + * * @param classVisitor * the visitor that must visit this class. * @param attrs @@ -699,7 +699,7 @@ public void accept(final ClassVisitor classVisitor, /** * Reads a field and makes the given visitor visit it. - * + * * @param classVisitor * the visitor that must visit the field. * @param context @@ -817,7 +817,7 @@ private int readField(final ClassVisitor classVisitor, /** * Reads a method and makes the given visitor visit it. - * + * * @param classVisitor * the visitor that must visit the method. * @param context @@ -1025,7 +1025,7 @@ private int readMethod(final ClassVisitor classVisitor, /** * Reads the bytecode of a method and makes the given visitor visit it. - * + * * @param mv * the visitor that must visit the method's code. * @param context @@ -1570,7 +1570,7 @@ context.end, context.index, readUTF8(v, c), /** * Parses a type annotation table to find the labels, and to visit the try * catch block annotations. - * + * * @param u * the start offset of a type annotation table. * @param mv @@ -1653,7 +1653,7 @@ private int[] readTypeAnnotations(final MethodVisitor mv, * start offset of the rest of the type_annotation structure (i.e. the * offset to the type_index field, which is followed by * num_element_value_pairs and then the name,value pairs). - * + * * @param context * information about the class being parsed. This is where the * extracted target_type and target_path must be stored. @@ -1724,7 +1724,7 @@ private int readAnnotationTarget(final Context context, int u) { /** * Reads parameter annotations and makes the given visitor visit them. - * + * * @param mv * the visitor that must visit the annotations. * @param context @@ -1767,7 +1767,7 @@ private void readParameterAnnotations(final MethodVisitor mv, /** * Reads the values of an annotation and makes the given visitor visit them. - * + * * @param v * the start offset in {@link #b b} of the values to be read * (including the unsigned short that gives the number of @@ -1803,7 +1803,7 @@ private int readAnnotationValues(int v, final char[] buf, /** * Reads a value of an annotation and makes the given visitor visit it. - * + * * @param v * the start offset in {@link #b b} of the value to be read * (not including the value name constant pool index). @@ -1966,7 +1966,7 @@ private int readAnnotationValue(int v, final char[] buf, final String name, /** * Computes the implicit frame of the method currently being parsed (as * defined in the given {@link Context}) and stores it in the given context. - * + * * @param frame * information about the class being parsed. */ @@ -2029,7 +2029,7 @@ private void getImplicitFrame(final Context frame) { /** * Reads a stack map frame and stores the result in the given * {@link Context} object. - * + * * @param stackMap * the start offset of a stack map frame in the class file. * @param zip @@ -2115,7 +2115,7 @@ private int readFrame(int stackMap, boolean zip, boolean unzip, /** * Reads a stack map frame type and stores it at the given index in the * given array. - * + * * @param frame * the array where the parsed type must be stored. * @param index @@ -2171,7 +2171,7 @@ private int readFrameType(final Object[] frame, final int index, int v, * Returns the label corresponding to the given offset. The default * implementation of this method creates a label for the given offset if it * has not been already created. - * + * * @param offset * a bytecode offset in a method. * @param labels @@ -2189,7 +2189,7 @@ protected Label readLabel(int offset, Label[] labels) { /** * Returns the start index of the attribute_info structure of this class. - * + * * @return the start index of the attribute_info structure of this class. */ private int getAttributes() { @@ -2215,7 +2215,7 @@ private int getAttributes() { /** * Reads an attribute in {@link #b b}. - * + * * @param attrs * prototypes of the attributes that must be parsed during the * visit of the class. Any attribute whose type is not equal to @@ -2263,7 +2263,7 @@ private Attribute readAttribute(final Attribute[] attrs, final String type, /** * Returns the number of constant pool items in {@link #b b}. - * + * * @return the number of constant pool items in {@link #b b}. */ public int getItemCount() { @@ -2274,7 +2274,7 @@ public int getItemCount() { * Returns the start index of the constant pool item in {@link #b b}, plus * one. This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param item * the index a constant pool item. * @return the start index of the constant pool item in {@link #b b}, plus @@ -2287,7 +2287,7 @@ public int getItem(final int item) { /** * Returns the maximum length of the strings contained in the constant pool * of the class. - * + * * @return the maximum length of the strings contained in the constant pool * of the class. */ @@ -2299,7 +2299,7 @@ public int getMaxStringLength() { * Reads a byte value in {@link #b b}. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2312,7 +2312,7 @@ public int readByte(final int index) { * Reads an unsigned short value in {@link #b b}. This method is intended * for {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2326,7 +2326,7 @@ public int readUnsignedShort(final int index) { * Reads a signed short value in {@link #b b}. This method is intended * for {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2340,7 +2340,7 @@ public short readShort(final int index) { * Reads a signed int value in {@link #b b}. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2355,7 +2355,7 @@ public int readInt(final int index) { * Reads a signed long value in {@link #b b}. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @param index * the start index of the value to be read in {@link #b b}. * @return the read value. @@ -2370,7 +2370,7 @@ public long readLong(final int index) { * Reads an UTF8 string constant pool item in {@link #b b}. This method * is intended for {@link Attribute} sub classes, and is normally not needed * by class generators or adapters. - * + * * @param index * the start index of an unsigned short value in {@link #b b}, * whose value is the index of an UTF8 constant pool item. @@ -2394,7 +2394,7 @@ public String readUTF8(int index, final char[] buf) { /** * Reads UTF8 string in {@link #b b}. - * + * * @param index * start offset of the UTF8 string to be read. * @param utfLen @@ -2445,7 +2445,7 @@ private String readUTF(int index, final int utfLen, final char[] buf) { * Reads a class constant pool item in {@link #b b}. This method is * intended for {@link Attribute} sub classes, and is normally not needed by * class generators or adapters. - * + * * @param index * the start index of an unsigned short value in {@link #b b}, * whose value is the index of a class constant pool item. @@ -2465,7 +2465,7 @@ public String readClass(final int index, final char[] buf) { * Reads a numeric or string constant pool item in {@link #b b}. This * method is intended for {@link Attribute} sub classes, and is normally not * needed by class generators or adapters. - * + * * @param item * the index of a constant pool item. * @param buf diff --git a/src/main/java/scala/tools/asm/ClassVisitor.java b/src/main/java/scala/tools/asm/ClassVisitor.java index 1b84507..48dc2ca 100644 --- a/src/main/java/scala/tools/asm/ClassVisitor.java +++ b/src/main/java/scala/tools/asm/ClassVisitor.java @@ -36,7 +36,7 @@ * visitTypeAnnotation | visitAttribute )* ( * visitInnerClass | visitField | visitMethod )* * visitEnd. - * + * * @author Eric Bruneton */ public abstract class ClassVisitor { @@ -55,7 +55,7 @@ public abstract class ClassVisitor { /** * Constructs a new {@link ClassVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -66,7 +66,7 @@ public ClassVisitor(final int api) { /** * Constructs a new {@link ClassVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -84,7 +84,7 @@ public ClassVisitor(final int api, final ClassVisitor cv) { /** * Visits the header of the class. - * + * * @param version * the class version. * @param access @@ -116,7 +116,7 @@ public void visit(int version, int access, String name, String signature, /** * Visits the source of the class. - * + * * @param source * the name of the source file from which the class was compiled. * May be null. @@ -134,7 +134,7 @@ public void visitSource(String source, String debug) { /** * Visits the enclosing class of the class. This method must be called only * if the class has an enclosing class. - * + * * @param owner * internal name of the enclosing class of the class. * @param name @@ -154,7 +154,7 @@ public void visitOuterClass(String owner, String name, String desc) { /** * Visits an annotation of the class. - * + * * @param desc * the class descriptor of the annotation class. * @param visible @@ -171,7 +171,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) { /** * Visits an annotation on a type in the class signature. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#CLASS_TYPE_PARAMETER @@ -204,7 +204,7 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef, /** * Visits a non standard attribute of the class. - * + * * @param attr * an attribute. */ @@ -217,7 +217,7 @@ public void visitAttribute(Attribute attr) { /** * Visits information about an inner class. This inner class is not * necessarily a member of the class being visited. - * + * * @param name * the internal name of an inner class (see * {@link Type#getInternalName() getInternalName}). @@ -241,7 +241,7 @@ public void visitInnerClass(String name, String outerName, /** * Visits a field of the class. - * + * * @param access * the field's access flags (see {@link Opcodes}). This parameter * also indicates if the field is synthetic and/or deprecated. @@ -278,7 +278,7 @@ public FieldVisitor visitField(int access, String name, String desc, * Visits a method of the class. This method must return a new * {@link MethodVisitor} instance (or null) each time it is called, * i.e., it should not return a previously returned visitor. - * + * * @param access * the method's access flags (see {@link Opcodes}). This * parameter also indicates if the method is synthetic and/or diff --git a/src/main/java/scala/tools/asm/ClassWriter.java b/src/main/java/scala/tools/asm/ClassWriter.java index 6625e47..afa335f 100644 --- a/src/main/java/scala/tools/asm/ClassWriter.java +++ b/src/main/java/scala/tools/asm/ClassWriter.java @@ -35,7 +35,7 @@ * file format. It can be used alone, to generate a Java class "from scratch", * or with one or more {@link ClassReader ClassReader} and adapter class visitor * to generate a modified class from one or more existing Java classes. - * + * * @author Eric Bruneton */ public class ClassWriter extends ClassVisitor { @@ -47,7 +47,7 @@ public class ClassWriter extends ClassVisitor { * {@link MethodVisitor} returned by the {@link #visitMethod visitMethod} * method will be ignored, and computed automatically from the signature and * the bytecode of each method. - * + * * @see #ClassWriter(int) */ public static final int COMPUTE_MAXS = 1; @@ -60,7 +60,7 @@ public class ClassWriter extends ClassVisitor { * {@link MethodVisitor#visitMaxs visitMaxs} method are also ignored and * recomputed from the bytecode. In other words, computeFrames implies * computeMaxs. - * + * * @see #ClassWriter(int) */ public static final int COMPUTE_FRAMES = 2; @@ -598,7 +598,7 @@ public class ClassWriter extends ClassVisitor { /** * Constructs a new {@link ClassWriter} object. - * + * * @param flags * option flags that can be used to modify the default behavior * of this class. See {@link #COMPUTE_MAXS}, @@ -622,7 +622,7 @@ public ClassWriter(final int flags) { * Constructs a new {@link ClassWriter} object and enables optimizations for * "mostly add" bytecode transformations. These optimizations are the * following: - * + * *
    *
  • The constant pool from the original class is copied as is in the new * class, which saves time. New constant pool entries will be added at the @@ -636,7 +636,7 @@ public ClassWriter(final int flags) { * a {@link ClassWriter} (and not from any other {@link ClassVisitor} * instance).
  • *
- * + * * @param classReader * the {@link ClassReader} used to read the original class. It * will be used to copy the entire constant pool from the @@ -804,7 +804,7 @@ public final void visitEnd() { /** * Returns the bytecode of the class that was build with this class writer. - * + * * @return the bytecode of the class that was build with this class writer. */ public byte[] toByteArray() { @@ -1005,7 +1005,7 @@ public byte[] toByteArray() { /** * Adds a number or string constant to the constant pool of the class being * build. Does nothing if the constant pool already contains a similar item. - * + * * @param cst * the value of the constant to be added to the constant pool. * This parameter must be an {@link Integer}, a {@link Float}, a @@ -1063,7 +1063,7 @@ Item newConstItem(final Object cst) { * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param cst * the value of the constant to be added to the constant pool. * This parameter must be an {@link Integer}, a {@link Float}, a @@ -1080,7 +1080,7 @@ public int newConst(final Object cst) { * nothing if the constant pool already contains a similar item. This * method is intended for {@link Attribute} sub classes, and is normally not * needed by class generators or adapters. - * + * * @param value * the String value. * @return the index of a new or already existing UTF8 item. @@ -1101,7 +1101,7 @@ public int newUTF8(final String value) { * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param value * the internal name of the class. * @return a new or already existing class reference item. @@ -1122,7 +1122,7 @@ Item newClassItem(final String value) { * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param value * the internal name of the class. * @return the index of a new or already existing class reference item. @@ -1136,7 +1136,7 @@ public int newClass(final String value) { * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param methodDesc * method descriptor of the method type. * @return a new or already existing method type reference item. @@ -1157,7 +1157,7 @@ Item newMethodTypeItem(final String methodDesc) { * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param methodDesc * method descriptor of the method type. * @return the index of a new or already existing method type reference @@ -1172,7 +1172,7 @@ public int newMethodType(final String methodDesc) { * if the constant pool already contains a similar item. This method is * intended for {@link Attribute} sub classes, and is normally not needed by * class generators or adapters. - * + * * @param tag * the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, @@ -1214,7 +1214,7 @@ Item newHandleItem(final int tag, final String owner, final String name, * if the constant pool already contains a similar item. This method is * intended for {@link Attribute} sub classes, and is normally not needed by * class generators or adapters. - * + * * @param tag * the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, @@ -1231,7 +1231,7 @@ Item newHandleItem(final int tag, final String owner, final String name, * the descriptor of the field or method. * @return the index of a new or already existing method type reference * item. - * + * * @deprecated this method is superseded by * {@link #newHandle(int, String, String, String, boolean)}. */ @@ -1246,7 +1246,7 @@ public int newHandle(final int tag, final String owner, final String name, * if the constant pool already contains a similar item. This method is * intended for {@link Attribute} sub classes, and is normally not needed by * class generators or adapters. - * + * * @param tag * the kind of this handle. Must be {@link Opcodes#H_GETFIELD}, * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD}, @@ -1270,13 +1270,13 @@ public int newHandle(final int tag, final String owner, final String name, final String desc, final boolean itf) { return newHandleItem(tag, owner, name, desc, itf).index; } - + /** * Adds an invokedynamic reference to the constant pool of the class being * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param name * name of the invoked method. * @param desc @@ -1285,7 +1285,7 @@ public int newHandle(final int tag, final String owner, final String name, * the bootstrap method. * @param bsmArgs * the bootstrap method constant arguments. - * + * * @return a new or an already existing invokedynamic type reference item. */ Item newInvokeDynamicItem(final String name, final String desc, @@ -1360,7 +1360,7 @@ Item newInvokeDynamicItem(final String name, final String desc, * build. Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param name * name of the invoked method. * @param desc @@ -1369,7 +1369,7 @@ Item newInvokeDynamicItem(final String name, final String desc, * the bootstrap method. * @param bsmArgs * the bootstrap method constant arguments. - * + * * @return the index of a new or already existing invokedynamic reference * item. */ @@ -1381,7 +1381,7 @@ public int newInvokeDynamic(final String name, final String desc, /** * Adds a field reference to the constant pool of the class being build. * Does nothing if the constant pool already contains a similar item. - * + * * @param owner * the internal name of the field's owner class. * @param name @@ -1406,7 +1406,7 @@ Item newFieldItem(final String owner, final String name, final String desc) { * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param owner * the internal name of the field's owner class. * @param name @@ -1422,7 +1422,7 @@ public int newField(final String owner, final String name, final String desc) { /** * Adds a method reference to the constant pool of the class being build. * Does nothing if the constant pool already contains a similar item. - * + * * @param owner * the internal name of the method's owner class. * @param name @@ -1451,7 +1451,7 @@ Item newMethodItem(final String owner, final String name, * Does nothing if the constant pool already contains a similar item. * This method is intended for {@link Attribute} sub classes, and is * normally not needed by class generators or adapters. - * + * * @param owner * the internal name of the method's owner class. * @param name @@ -1470,7 +1470,7 @@ public int newMethod(final String owner, final String name, /** * Adds an integer to the constant pool of the class being build. Does * nothing if the constant pool already contains a similar item. - * + * * @param value * the int value. * @return a new or already existing int item. @@ -1489,7 +1489,7 @@ Item newInteger(final int value) { /** * Adds a float to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the float value. * @return a new or already existing float item. @@ -1508,7 +1508,7 @@ Item newFloat(final float value) { /** * Adds a long to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the long value. * @return a new or already existing long item. @@ -1528,7 +1528,7 @@ Item newLong(final long value) { /** * Adds a double to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the double value. * @return a new or already existing double item. @@ -1548,7 +1548,7 @@ Item newDouble(final double value) { /** * Adds a string to the constant pool of the class being build. Does nothing * if the constant pool already contains a similar item. - * + * * @param value * the String value. * @return a new or already existing string item. @@ -1569,7 +1569,7 @@ private Item newString(final String value) { * nothing if the constant pool already contains a similar item. This * method is intended for {@link Attribute} sub classes, and is normally not * needed by class generators or adapters. - * + * * @param name * a name. * @param desc @@ -1583,7 +1583,7 @@ public int newNameType(final String name, final String desc) { /** * Adds a name and type to the constant pool of the class being build. Does * nothing if the constant pool already contains a similar item. - * + * * @param name * a name. * @param desc @@ -1604,7 +1604,7 @@ Item newNameTypeItem(final String name, final String desc) { /** * Adds the given internal name to {@link #typeTable} and returns its index. * Does nothing if the type table already contains this internal name. - * + * * @param type * the internal name to be added to the type table. * @return the index of this internal name in the type table. @@ -1622,7 +1622,7 @@ int addType(final String type) { * Adds the given "uninitialized" type to {@link #typeTable} and returns its * index. This method is used for UNINITIALIZED types, made of an internal * name and a bytecode offset. - * + * * @param type * the internal name to be added to the type table. * @param offset @@ -1644,7 +1644,7 @@ int addUninitializedType(final String type, final int offset) { /** * Adds the given Item to {@link #typeTable}. - * + * * @param item * the value to be added to the type table. * @return the added Item, which a new Item instance with the same value as @@ -1671,7 +1671,7 @@ private Item addType(final Item item) { * method calls {@link #getCommonSuperClass} and caches the result in the * {@link #items} hash table to speedup future calls with the same * parameters. - * + * * @param type1 * index of an internal name in {@link #typeTable}. * @param type2 @@ -1701,7 +1701,7 @@ int getMergedType(final int type1, final int type2) { * without actually loading any class, or to take into account the class * that is currently being generated by this ClassWriter, which can of * course not be loaded since it is under construction. - * + * * @param type1 * the internal name of a class. * @param type2 @@ -1737,7 +1737,7 @@ protected String getCommonSuperClass(final String type1, final String type2) { /** * Returns the constant pool's hash table item which is equal to the given * item. - * + * * @param key * a constant pool item. * @return the constant pool's hash table item which is equal to the given @@ -1754,7 +1754,7 @@ private Item get(final Item key) { /** * Puts the given item in the constant pool's hash table. The hash table * must not already contains this item. - * + * * @param i * the item to be added to the constant pool's hash table. */ @@ -1783,7 +1783,7 @@ private void put(final Item i) { /** * Puts one byte and two shorts into the constant pool. - * + * * @param b * a byte. * @param s1 @@ -1797,7 +1797,7 @@ private void put122(final int b, final int s1, final int s2) { /** * Puts two bytes and one short into the constant pool. - * + * * @param b1 * a byte. * @param b2 diff --git a/src/main/java/scala/tools/asm/Context.java b/src/main/java/scala/tools/asm/Context.java index 872ef28..782d431 100644 --- a/src/main/java/scala/tools/asm/Context.java +++ b/src/main/java/scala/tools/asm/Context.java @@ -32,7 +32,7 @@ /** * Information about a class being parsed in a {@link ClassReader}. - * + * * @author Eric Bruneton */ class Context { diff --git a/src/main/java/scala/tools/asm/Edge.java b/src/main/java/scala/tools/asm/Edge.java index 65e128a..daac1f7 100644 --- a/src/main/java/scala/tools/asm/Edge.java +++ b/src/main/java/scala/tools/asm/Edge.java @@ -31,7 +31,7 @@ /** * An edge in the control flow graph of a method body. See {@link Label Label}. - * + * * @author Eric Bruneton */ class Edge { diff --git a/src/main/java/scala/tools/asm/FieldVisitor.java b/src/main/java/scala/tools/asm/FieldVisitor.java index 7448720..708c1d3 100644 --- a/src/main/java/scala/tools/asm/FieldVisitor.java +++ b/src/main/java/scala/tools/asm/FieldVisitor.java @@ -33,7 +33,7 @@ * A visitor to visit a Java field. The methods of this class must be called in * the following order: ( visitAnnotation | * visitTypeAnnotation | visitAttribute )* visitEnd. - * + * * @author Eric Bruneton */ public abstract class FieldVisitor { @@ -52,7 +52,7 @@ public abstract class FieldVisitor { /** * Constructs a new {@link FieldVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -63,7 +63,7 @@ public FieldVisitor(final int api) { /** * Constructs a new {@link FieldVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -81,7 +81,7 @@ public FieldVisitor(final int api, final FieldVisitor fv) { /** * Visits an annotation of the field. - * + * * @param desc * the class descriptor of the annotation class. * @param visible @@ -98,7 +98,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) { /** * Visits an annotation on the type of the field. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#FIELD FIELD}. See @@ -127,7 +127,7 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef, /** * Visits a non standard attribute of the field. - * + * * @param attr * an attribute. */ diff --git a/src/main/java/scala/tools/asm/FieldWriter.java b/src/main/java/scala/tools/asm/FieldWriter.java index cf33c04..e640a8d 100644 --- a/src/main/java/scala/tools/asm/FieldWriter.java +++ b/src/main/java/scala/tools/asm/FieldWriter.java @@ -31,7 +31,7 @@ /** * An {@link FieldVisitor} that generates Java fields in bytecode form. - * + * * @author Eric Bruneton */ final class FieldWriter extends FieldVisitor { @@ -102,7 +102,7 @@ final class FieldWriter extends FieldVisitor { /** * Constructs a new {@link FieldWriter}. - * + * * @param cw * the class writer to which this field must be added. * @param access @@ -200,7 +200,7 @@ public void visitEnd() { /** * Returns the size of this field. - * + * * @return the size of this field. */ int getSize() { @@ -248,7 +248,7 @@ int getSize() { /** * Puts the content of this field into the given byte vector. - * + * * @param out * where the content of this field must be put. */ diff --git a/src/main/java/scala/tools/asm/Frame.java b/src/main/java/scala/tools/asm/Frame.java index 94008ac..85ad326 100644 --- a/src/main/java/scala/tools/asm/Frame.java +++ b/src/main/java/scala/tools/asm/Frame.java @@ -31,7 +31,7 @@ /** * Information about the input and output stack map frames of a basic block. - * + * * @author Eric Bruneton */ final class Frame { @@ -46,14 +46,14 @@ final class Frame { * of the first basic block (which is computed from the method descriptor), * and by using the previously computed output frames to compute the input * state of the other blocks. - * + * * All output and input frames are stored as arrays of integers. Reference * and array types are represented by an index into a type table (which is * not the same as the constant pool of the class, in order to avoid adding * unnecessary constants in the pool - not all computed frames will end up * being stored in the stack map table). This allows very fast type * comparisons. - * + * * Output stack map frames are computed relatively to the input frame of the * basic block, which is not yet known when output frames are computed. It * is therefore necessary to be able to represent abstract types such as @@ -61,7 +61,7 @@ final class Frame { * position x from the top of the input frame stack" or even "the type at * position x in the input frame, with y more (or less) array dimensions". * This explains the rather complicated type format used in output frames. - * + * * This format is the following: DIM KIND VALUE (4, 4 and 24 bits). DIM is a * signed number of array dimensions (from -8 to 7). KIND is either BASE, * LOCAL or STACK. BASE is used for types that are not relative to the input @@ -72,14 +72,14 @@ final class Frame { * relatively to the top of input frame stack. For BASE types, it is either * one of the constants defined below, or for OBJECT and UNINITIALIZED * types, a tag and an index in the type table. - * + * * Output frames can contain types of any kind and with a positive or * negative dimension (and even unassigned types, represented by 0 - which * does not correspond to any valid type value). Input frames can only * contain BASE types of positive or null dimension. In all cases the type * table contains only internal type names (array type descriptors are * forbidden - dimensions must be represented through the DIM field). - * + * * The LONG and DOUBLE types are always represented by using two slots (LONG * + TOP or DOUBLE + TOP), for local variable types as well as in the * operand stack. This is necessary to be able to simulate DUPx_y @@ -107,7 +107,7 @@ final class Frame { /** * Mask to get the kind of a frame type. - * + * * @see #BASE * @see #LOCAL * @see #STACK @@ -489,10 +489,10 @@ final class Frame { /** * Relative size of the output stack. The exact semantics of this field * depends on the algorithm that is used. - * + * * When only the maximum stack size is computed, this field is the size of * the output stack relatively to the top of the input stack. - * + * * When the stack map frames are completely computed, this field is the * actual number of types in {@link #outputStack}. */ @@ -500,7 +500,7 @@ final class Frame { /** * Number of types that are initialized in the basic block. - * + * * @see #initializations */ private int initializationCount; @@ -522,7 +522,7 @@ final class Frame { /** * Returns the output frame local variable type at the given index. - * + * * @param local * the index of the local that must be returned. * @return the output frame local variable type at the given index. @@ -545,7 +545,7 @@ private int get(final int local) { /** * Sets the output frame local variable type at the given index. - * + * * @param local * the index of the local that must be set. * @param type @@ -568,7 +568,7 @@ private void set(final int local, final int type) { /** * Pushes a new type onto the output frame stack. - * + * * @param type * the type that must be pushed. */ @@ -594,7 +594,7 @@ private void push(final int type) { /** * Pushes a new type onto the output frame stack. - * + * * @param cw * the ClassWriter to which this label belongs. * @param desc @@ -614,7 +614,7 @@ private void push(final ClassWriter cw, final String desc) { /** * Returns the int encoding of the given type. - * + * * @param cw * the ClassWriter to which this label belongs. * @param desc @@ -688,7 +688,7 @@ private static int type(final ClassWriter cw, final String desc) { /** * Pops a type from the output frame stack and returns its value. - * + * * @return the type that has been popped from the output frame stack. */ private int pop() { @@ -702,7 +702,7 @@ private int pop() { /** * Pops the given number of types from the output frame stack. - * + * * @param elements * the number of types that must be popped. */ @@ -720,7 +720,7 @@ private void pop(final int elements) { /** * Pops a type from the output frame stack. - * + * * @param desc * the descriptor of the type to be popped. Can also be a method * descriptor (in this case this method pops the types @@ -740,7 +740,7 @@ private void pop(final String desc) { /** * Adds a new type to the list of types on which a constructor is invoked in * the basic block. - * + * * @param var * a type on a which a constructor is invoked. */ @@ -762,7 +762,7 @@ private void init(final int var) { /** * Replaces the given type with the appropriate type if it is one of the * types on which a constructor is invoked in the basic block. - * + * * @param cw * the ClassWriter to which this label belongs. * @param t @@ -799,7 +799,7 @@ private int init(final ClassWriter cw, final int t) { /** * Initializes the input frame of the first basic block from the method * descriptor. - * + * * @param cw * the ClassWriter to which this label belongs. * @param access @@ -835,7 +835,7 @@ void initInputFrame(final ClassWriter cw, final int access, /** * Simulates the action of the given instruction on the output stack frame. - * + * * @param opcode * the opcode of the instruction. * @param arg @@ -1272,7 +1272,7 @@ void execute(final int opcode, final int arg, final ClassWriter cw, * Merges the input frame of the given basic block with the input and output * frames of this basic block. Returns true if the input frame of * the given label has been changed by this operation. - * + * * @param cw * the ClassWriter to which this label belongs. * @param frame @@ -1380,7 +1380,7 @@ boolean merge(final ClassWriter cw, final Frame frame, final int edge) { * Merges the type at the given index in the given type array with the given * type. Returns true if the type array has been modified by this * operation. - * + * * @param cw * the ClassWriter to which this label belongs. * @param t diff --git a/src/main/java/scala/tools/asm/Handle.java b/src/main/java/scala/tools/asm/Handle.java index 620295e..0a4863c 100644 --- a/src/main/java/scala/tools/asm/Handle.java +++ b/src/main/java/scala/tools/asm/Handle.java @@ -32,7 +32,7 @@ /** * A reference to a field or a method. - * + * * @author Remi Forax * @author Eric Bruneton */ @@ -63,8 +63,8 @@ public final class Handle { * The descriptor of the field or method designated by this handle. */ final String desc; - - + + /** * Indicate if the owner is an interface or not. */ @@ -72,7 +72,7 @@ public final class Handle { /** * Constructs a new field or method handle. - * + * * @param tag * the kind of field or method designated by this Handle. Must be * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, @@ -90,7 +90,7 @@ public final class Handle { * @param desc * the descriptor of the field or method designated by this * handle. - * + * * @deprecated this constructor has been superseded * by {@link #Handle(int, String, String, String, boolean)}. */ @@ -101,7 +101,7 @@ public Handle(int tag, String owner, String name, String desc) { /** * Constructs a new field or method handle. - * + * * @param tag * the kind of field or method designated by this Handle. Must be * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, @@ -129,10 +129,10 @@ public Handle(int tag, String owner, String name, String desc, boolean itf) { this.desc = desc; this.itf = itf; } - + /** * Returns the kind of field or method designated by this handle. - * + * * @return {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, * {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC}, @@ -147,7 +147,7 @@ public int getTag() { /** * Returns the internal name of the class that owns the field or method * designated by this handle. - * + * * @return the internal name of the class that owns the field or method * designated by this handle. */ @@ -157,7 +157,7 @@ public String getOwner() { /** * Returns the name of the field or method designated by this handle. - * + * * @return the name of the field or method designated by this handle. */ public String getName() { @@ -166,17 +166,17 @@ public String getName() { /** * Returns the descriptor of the field or method designated by this handle. - * + * * @return the descriptor of the field or method designated by this handle. */ public String getDesc() { return desc; } - + /** * Returns true if the owner of the field or method designated * by this handle is an interface. - * + * * @return true if the owner of the field or method designated * by this handle is an interface. */ @@ -205,14 +205,14 @@ public int hashCode() { /** * Returns the textual representation of this handle. The textual * representation is: - * + * *
      * for a reference to a class:
      * owner '.' name desc ' ' '(' tag ')'
      * for a reference to an interface:
      * owner '.' name desc ' ' '(' tag ' ' itf ')'
      * 
- * + * * . As this format is unambiguous, it can be parsed if necessary. */ @Override diff --git a/src/main/java/scala/tools/asm/Handler.java b/src/main/java/scala/tools/asm/Handler.java index b3db4ce..a06cb81 100644 --- a/src/main/java/scala/tools/asm/Handler.java +++ b/src/main/java/scala/tools/asm/Handler.java @@ -31,7 +31,7 @@ /** * Information about an exception handler block. - * + * * @author Eric Bruneton */ class Handler { @@ -71,7 +71,7 @@ class Handler { /** * Removes the range between start and end from the given exception * handlers. - * + * * @param h * an exception handler list. * @param start diff --git a/src/main/java/scala/tools/asm/Item.java b/src/main/java/scala/tools/asm/Item.java index 68ff809..4cf78bf 100644 --- a/src/main/java/scala/tools/asm/Item.java +++ b/src/main/java/scala/tools/asm/Item.java @@ -32,7 +32,7 @@ /** * A constant pool item. Constant pool items can be created with the 'newXXX' * methods in the {@link ClassWriter} class. - * + * * @author Eric Bruneton */ final class Item { @@ -52,11 +52,11 @@ final class Item { * {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD}, * {@link ClassWriter#METH}, {@link ClassWriter#IMETH}, * {@link ClassWriter#MTYPE}, {@link ClassWriter#INDY}. - * + * * MethodHandle constant 9 variations are stored using a range of 9 values * from {@link ClassWriter#HANDLE_BASE} + 1 to * {@link ClassWriter#HANDLE_BASE} + 9. - * + * * Special Item types are used for Items that are stored in the ClassWriter * {@link ClassWriter#typeTable}, instead of the constant pool, in order to * avoid clashes with normal constant pool items in the ClassWriter constant @@ -114,7 +114,7 @@ final class Item { /** * Constructs an uninitialized {@link Item} for constant pool element at * given position. - * + * * @param index * index of the item to be constructed. */ @@ -124,7 +124,7 @@ final class Item { /** * Constructs a copy of the given item. - * + * * @param index * index of the item to be constructed. * @param i @@ -143,7 +143,7 @@ final class Item { /** * Sets this item to an integer item. - * + * * @param intVal * the value of this item. */ @@ -155,7 +155,7 @@ void set(final int intVal) { /** * Sets this item to a long item. - * + * * @param longVal * the value of this item. */ @@ -167,7 +167,7 @@ void set(final long longVal) { /** * Sets this item to a float item. - * + * * @param floatVal * the value of this item. */ @@ -179,7 +179,7 @@ void set(final float floatVal) { /** * Sets this item to a double item. - * + * * @param doubleVal * the value of this item. */ @@ -191,7 +191,7 @@ void set(final double doubleVal) { /** * Sets this item to an item that do not hold a primitive value. - * + * * @param type * the type of this item. * @param strVal1 @@ -234,7 +234,7 @@ void set(final int type, final String strVal1, final String strVal2, /** * Sets the item to an InvokeDynamic item. - * + * * @param name * invokedynamic's name. * @param desc @@ -253,7 +253,7 @@ void set(String name, String desc, int bsmIndex) { /** * Sets the item to a BootstrapMethod item. - * + * * @param position * position in byte in the class attribute BootrapMethods. * @param hashCode @@ -270,7 +270,7 @@ void set(int position, int hashCode) { /** * Indicates if the given item is equal to this one. This method assumes * that the two items have the same {@link #type}. - * + * * @param i * the item to be compared to this one. Both items must have the * same {@link #type}. diff --git a/src/main/java/scala/tools/asm/Label.java b/src/main/java/scala/tools/asm/Label.java index 45670df..70ff002 100644 --- a/src/main/java/scala/tools/asm/Label.java +++ b/src/main/java/scala/tools/asm/Label.java @@ -35,7 +35,7 @@ * designates the instruction that is just after. Note however that there * can be other elements between a label and the instruction it designates (such * as other labels, stack map frames, line numbers, etc.). - * + * * @author Eric Bruneton */ public class Label { @@ -117,7 +117,7 @@ public class Label { /** * Flags that indicate the status of this label. - * + * * @see #DEBUG * @see #RESOLVED * @see #RESIZED @@ -174,7 +174,7 @@ public class Label { * represented by the Label object that corresponds to the first instruction * of this basic block. Each node also stores the list of its successors in * the graph, as a linked list of Edge objects. - * + * * The control flow analysis algorithms used to compute the maximum stack * size or the stack map frames are similar and use two steps. The first * step, during the visit of each instruction, builds information about the @@ -186,7 +186,7 @@ public class Label { * information about the input frame of each basic block, from the input * state of the first basic block (known from the method signature), and by * the using the previously computed relative output frames. - * + * * The algorithm used to compute the maximum stack size only computes the * relative output and absolute input stack heights, while the algorithm * used to compute stack map frames computes relative output frames and @@ -196,10 +196,10 @@ public class Label { /** * Start of the output stack relatively to the input stack. The exact * semantics of this field depends on the algorithm that is used. - * + * * When only the maximum stack size is computed, this field is the number of * elements in the input stack. - * + * * When the stack map frames are completely computed, this field is the * offset of the first output stack element relatively to the top of the * input stack. This offset is always negative or null. A null offset means @@ -243,9 +243,9 @@ public class Label { * The next basic block in the basic block stack. This stack is used in the * main loop of the fix point algorithm used in the second step of the * control flow analysis algorithms. It is also used in - * {@link #visitSubroutine} to avoid using a recursive method, and in - * ClassReader to temporarily store multiple source lines for a label. - * + * {@link #visitSubroutine} to avoid using a recursive method, and in + * ClassReader to temporarily store multiple source lines for a label. + * * @see MethodWriter#visitMaxs */ Label next; @@ -269,7 +269,7 @@ public Label() { * from the start of the method's bytecode. This method is intended for * {@link Attribute} sub classes, and is normally not needed by class * generators or adapters. - * + * * @return the offset corresponding to this label. * @throws IllegalStateException * if this label is not resolved yet. @@ -287,7 +287,7 @@ public int getOffset() { * position of the label is known, the offset is computed and written * directly. Otherwise, a null offset is written and a new forward reference * is declared for this label. - * + * * @param owner * the code writer that calls this method. * @param out @@ -325,7 +325,7 @@ void put(final MethodWriter owner, final ByteVector out, final int source, * for a true forward reference, i.e. only if this label is not resolved * yet. For backward references, the offset of the reference can be, and * must be, computed and stored directly. - * + * * @param sourcePosition * the position of the referencing instruction. This position * will be used to compute the offset of this forward reference. @@ -353,7 +353,7 @@ private void addReference(final int sourcePosition, * when this label is added to the bytecode of the method, i.e. when its * position becomes known. This method fills in the blanks that where left * in the bytecode by each forward reference previously added to this label. - * + * * @param owner * the code writer that calls this method. * @param position @@ -421,7 +421,7 @@ boolean resolve(final MethodWriter owner, final int position, * isolated label or for the first label in a series of successive labels, * this method returns the label itself. For other labels it returns the * first label of the series. - * + * * @return the first label of the series to which this label belongs. */ Label getFirst() { @@ -434,7 +434,7 @@ Label getFirst() { /** * Returns true is this basic block belongs to the given subroutine. - * + * * @param id * a subroutine id. * @return true is this basic block belongs to the given subroutine. @@ -449,7 +449,7 @@ boolean inSubroutine(final long id) { /** * Returns true if this basic block and the given one belong to a common * subroutine. - * + * * @param block * another basic block. * @return true if this basic block and the given one belong to a common @@ -469,7 +469,7 @@ boolean inSameSubroutine(final Label block) { /** * Marks this basic block as belonging to the given subroutine. - * + * * @param id * a subroutine id. * @param nbSubroutines @@ -488,7 +488,7 @@ void addToSubroutine(final long id, final int nbSubroutines) { * blocks as belonging to this subroutine. This method follows the control * flow graph to find all the blocks that are reachable from the current * block WITHOUT following any JSR target. - * + * * @param JSR * a JSR block that jumps to this subroutine. If this JSR is not * null it is added to the successor of the RET blocks found in @@ -555,7 +555,7 @@ void visitSubroutine(final Label JSR, final long id, final int nbSubroutines) { /** * Returns a string representation of this label. - * + * * @return a string representation of this label. */ @Override diff --git a/src/main/java/scala/tools/asm/MethodVisitor.java b/src/main/java/scala/tools/asm/MethodVisitor.java index 559ba0f..fc1e1df 100644 --- a/src/main/java/scala/tools/asm/MethodVisitor.java +++ b/src/main/java/scala/tools/asm/MethodVisitor.java @@ -50,7 +50,7 @@ * visitLocalVariable, visitLocalVariableAnnotation and * visitLineNumber methods must be called after the labels * passed as arguments have been visited. - * + * * @author Eric Bruneton */ public abstract class MethodVisitor { @@ -69,7 +69,7 @@ public abstract class MethodVisitor { /** * Constructs a new {@link MethodVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -80,7 +80,7 @@ public MethodVisitor(final int api) { /** * Constructs a new {@link MethodVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -102,7 +102,7 @@ public MethodVisitor(final int api, final MethodVisitor mv) { /** * Visits a parameter of this method. - * + * * @param name * parameter name or null if none is provided. * @param access @@ -121,7 +121,7 @@ public void visitParameter(String name, int access) { /** * Visits the default value of this annotation interface method. - * + * * @return a visitor to the visit the actual default value of this * annotation interface method, or null if this visitor is * not interested in visiting this default value. The 'name' @@ -138,7 +138,7 @@ public AnnotationVisitor visitAnnotationDefault() { /** * Visits an annotation of this method. - * + * * @param desc * the class descriptor of the annotation class. * @param visible @@ -155,7 +155,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) { /** * Visits an annotation on a type in the method signature. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#METHOD_TYPE_PARAMETER @@ -191,7 +191,7 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef, /** * Visits an annotation of a parameter this method. - * + * * @param parameter * the parameter index. * @param desc @@ -211,7 +211,7 @@ public AnnotationVisitor visitParameterAnnotation(int parameter, /** * Visits a non standard attribute of this method. - * + * * @param attr * an attribute. */ @@ -272,7 +272,7 @@ public void visitCode() { * and access flags, is implicit and must not be visited. Also, it is * illegal to visit two or more frames for the same code location (i.e., at * least one instruction must be visited between two calls to visitFrame). - * + * * @param type * the type of this stack map frame. Must be * {@link Opcodes#F_NEW} for expanded frames, or @@ -318,7 +318,7 @@ public void visitFrame(int type, int nLocal, Object[] local, int nStack, /** * Visits a zero operand instruction. - * + * * @param opcode * the opcode of the instruction to be visited. This opcode is * either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, @@ -344,7 +344,7 @@ public void visitInsn(int opcode) { /** * Visits an instruction with a single int operand. - * + * * @param opcode * the opcode of the instruction to be visited. This opcode is * either BIPUSH, SIPUSH or NEWARRAY. @@ -369,7 +369,7 @@ public void visitIntInsn(int opcode, int operand) { /** * Visits a local variable instruction. A local variable instruction is an * instruction that loads or stores the value of a local variable. - * + * * @param opcode * the opcode of the local variable instruction to be visited. * This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, @@ -387,7 +387,7 @@ public void visitVarInsn(int opcode, int var) { /** * Visits a type instruction. A type instruction is an instruction that * takes the internal name of a class as parameter. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF. @@ -405,7 +405,7 @@ public void visitTypeInsn(int opcode, String type) { /** * Visits a field instruction. A field instruction is an instruction that * loads or stores the value of a field of an object. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. @@ -427,7 +427,7 @@ public void visitFieldInsn(int opcode, String owner, String name, /** * Visits a method instruction. A method instruction is an instruction that * invokes a method. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or @@ -456,7 +456,7 @@ public void visitMethodInsn(int opcode, String owner, String name, /** * Visits a method instruction. A method instruction is an instruction that * invokes a method. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or @@ -488,7 +488,7 @@ public void visitMethodInsn(int opcode, String owner, String name, /** * Visits an invokedynamic instruction. - * + * * @param name * the method's name. * @param desc @@ -512,7 +512,7 @@ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, /** * Visits a jump instruction. A jump instruction is an instruction that may * jump to another instruction. - * + * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, @@ -532,7 +532,7 @@ public void visitJumpInsn(int opcode, Label label) { /** * Visits a label. A label designates the instruction that will be visited * just after it. - * + * * @param label * a {@link Label Label} object. */ @@ -551,7 +551,7 @@ public void visitLabel(Label label) { * future versions of the Java Virtual Machine. To easily detect new * constant types, implementations of this method should check for * unexpected constant types, like this: - * + * *
      * if (cst instanceof Integer) {
      *     // ...
@@ -580,7 +580,7 @@ public void visitLabel(Label label) {
      *     // throw an exception
      * }
      * 
- * + * * @param cst * the constant to be loaded on the stack. This parameter must be * a non null {@link Integer}, a {@link Float}, a {@link Long}, a @@ -598,7 +598,7 @@ public void visitLdcInsn(Object cst) { /** * Visits an IINC instruction. - * + * * @param var * index of the local variable to be incremented. * @param increment @@ -612,7 +612,7 @@ public void visitIincInsn(int var, int increment) { /** * Visits a TABLESWITCH instruction. - * + * * @param min * the minimum key value. * @param max @@ -632,7 +632,7 @@ public void visitTableSwitchInsn(int min, int max, Label dflt, /** * Visits a LOOKUPSWITCH instruction. - * + * * @param dflt * beginning of the default handler block. * @param keys @@ -649,7 +649,7 @@ public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) { /** * Visits a MULTIANEWARRAY instruction. - * + * * @param desc * an array type descriptor (see {@link Type Type}). * @param dims @@ -665,7 +665,7 @@ public void visitMultiANewArrayInsn(String desc, int dims) { * Visits an annotation on an instruction. This method must be called just * after the annotated instruction. It can be called several times * for the same instruction. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#INSTANCEOF INSTANCEOF}, @@ -709,7 +709,7 @@ public AnnotationVisitor visitInsnAnnotation(int typeRef, /** * Visits a try catch block. - * + * * @param start * beginning of the exception handler's scope (inclusive). * @param end @@ -736,7 +736,7 @@ public void visitTryCatchBlock(Label start, Label end, Label handler, * called after the {@link #visitTryCatchBlock} for the annotated * exception handler. It can be called several times for the same exception * handler. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#EXCEPTION_PARAMETER @@ -765,7 +765,7 @@ public AnnotationVisitor visitTryCatchAnnotation(int typeRef, /** * Visits a local variable declaration. - * + * * @param name * the name of a local variable. * @param desc @@ -795,7 +795,7 @@ public void visitLocalVariable(String name, String desc, String signature, /** * Visits an annotation on a local variable type. - * + * * @param typeRef * a reference to the annotated type. The sort of this type * reference must be {@link TypeReference#LOCAL_VARIABLE @@ -837,7 +837,7 @@ public AnnotationVisitor visitLocalVariableAnnotation(int typeRef, /** * Visits a line number declaration. - * + * * @param line * a line number. This number refers to the source file from * which the class was compiled. @@ -856,7 +856,7 @@ public void visitLineNumber(int line, Label start) { /** * Visits the maximum stack size and the maximum number of local variables * of the method. - * + * * @param maxStack * maximum stack size of the method. * @param maxLocals diff --git a/src/main/java/scala/tools/asm/MethodWriter.java b/src/main/java/scala/tools/asm/MethodWriter.java index 08eb71f..af7fc53 100644 --- a/src/main/java/scala/tools/asm/MethodWriter.java +++ b/src/main/java/scala/tools/asm/MethodWriter.java @@ -33,7 +33,7 @@ * A {@link MethodVisitor} that generates methods in bytecode form. Each visit * method of this class appends the bytecode corresponding to the visited * instruction to a byte vector, in the order these methods are called. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -96,7 +96,7 @@ class MethodWriter extends MethodVisitor { * Indicates that the stack map frames must be recomputed from scratch. In * this case the maximum stack size and number of local variables is also * recomputed from scratch. - * + * * @see #compute */ private static final int FRAMES = 0; @@ -104,14 +104,14 @@ class MethodWriter extends MethodVisitor { /** * Indicates that the maximum stack size and number of local variables must * be automatically computed. - * + * * @see #compute */ private static final int MAXS = 1; /** * Indicates that nothing must be automatically computed. - * + * * @see #compute */ private static final int NOTHING = 2; @@ -263,7 +263,7 @@ class MethodWriter extends MethodVisitor { /** * The last frame that was written in the StackMapTable attribute. - * + * * @see #frame */ private int[] previousFrame; @@ -378,7 +378,7 @@ class MethodWriter extends MethodVisitor { /** * Indicates what must be automatically computed. - * + * * @see #FRAMES * @see #MAXS * @see #NOTHING @@ -428,7 +428,7 @@ class MethodWriter extends MethodVisitor { /** * Constructs a new {@link MethodWriter}. - * + * * @param cw * the class writer in which the method must be added. * @param access @@ -1657,7 +1657,7 @@ public void visitEnd() { /** * Adds a successor to the {@link #currentBlock currentBlock} block. - * + * * @param info * information about the control flow edge to be added. * @param successor @@ -1697,7 +1697,7 @@ private void noSuccessor() { /** * Visits a frame that has been computed from scratch. - * + * * @param f * the frame that must be visited. */ @@ -1813,7 +1813,7 @@ private void visitImplicitFirstFrame() { /** * Starts the visit of a stack map frame. - * + * * @param offset * the offset of the instruction to which the frame corresponds. * @param nLocal @@ -1942,7 +1942,7 @@ private void writeFrame() { * StackMapTableAttribute. This method converts types from the format used * in {@link Label} to the format used in StackMapTable attributes. In * particular, it converts type table indexes to constant pool indexes. - * + * * @param start * index of the first type in {@link #frame} to write. * @param end @@ -2023,7 +2023,7 @@ private void writeFrameType(final Object type) { /** * Returns the size of the bytecode of this method. - * + * * @return the size of the bytecode of this method. */ final int getSize() { @@ -2133,7 +2133,7 @@ final int getSize() { /** * Puts the bytecode of this method in the given byte vector. - * + * * @param out * the byte vector into which the bytecode of this method must be * copied. @@ -2379,17 +2379,17 @@ private void resizeInstructions() { * so on. The first step of the algorithm consists in finding all the * instructions that need to be resized, without modifying the code. * This is done by the following "fix point" algorithm: - * + * * Parse the code to find the jump instructions whose offset will need * more than 2 bytes to be stored (the future offset is computed from * the current offset and from the number of bytes that will be inserted * or removed between the source and target instructions). For each such * instruction, adds an entry in (a copy of) the indexes and sizes * arrays (if this has not already been done in a previous iteration!). - * + * * If at least one entry has been added during the previous step, go * back to the beginning, otherwise stop. - * + * * In fact the real algorithm is complicated by the fact that the size * of TABLESWITCH and LOOKUPSWITCH instructions depends on their * position in the bytecode (because of padding). In order to ensure the @@ -2790,7 +2790,7 @@ private void resizeInstructions() { /** * Reads an unsigned short value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2803,7 +2803,7 @@ static int readUnsignedShort(final byte[] b, final int index) { /** * Reads a signed short value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2816,7 +2816,7 @@ static short readShort(final byte[] b, final int index) { /** * Reads a signed int value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2830,7 +2830,7 @@ static int readInt(final byte[] b, final int index) { /** * Writes a short value in the given byte array. - * + * * @param b * a byte array. * @param index @@ -2849,7 +2849,7 @@ static void writeShort(final byte[] b, final int index, final int s) { * Note: it is possible to have several entries for the same instruction in * the indexes and sizes: two entries (index=a,size=b) and * (index=a,size=b') are equivalent to a single entry (index=a,size=b+b'). - * + * * @param indexes * current positions of the instructions to be resized. Each * instruction must be designated by the index of its last @@ -2887,7 +2887,7 @@ static int getNewOffset(final int[] indexes, final int[] sizes, /** * Updates the offset of the given label. - * + * * @param indexes * current positions of the instructions to be resized. Each * instruction must be designated by the index of its last diff --git a/src/main/java/scala/tools/asm/Opcodes.java b/src/main/java/scala/tools/asm/Opcodes.java index 793f0d7..24eaffa 100644 --- a/src/main/java/scala/tools/asm/Opcodes.java +++ b/src/main/java/scala/tools/asm/Opcodes.java @@ -37,7 +37,7 @@ * opcodes are therefore not defined in this interface. Likewise for LDC, * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and * JSR_W. - * + * * @author Eric Bruneton * @author Eugene Kuleshov */ diff --git a/src/main/java/scala/tools/asm/Type.java b/src/main/java/scala/tools/asm/Type.java index b23888e..a0aa170 100644 --- a/src/main/java/scala/tools/asm/Type.java +++ b/src/main/java/scala/tools/asm/Type.java @@ -35,7 +35,7 @@ /** * A Java field or method type. This class can be used to make it easier to * manipulate type and method descriptors. - * + * * @author Eric Bruneton * @author Chris Nokleberg */ @@ -189,7 +189,7 @@ public class Type { /** * Constructs a reference type. - * + * * @param sort * the sort of the reference type to be constructed. * @param buf @@ -208,7 +208,7 @@ private Type(final int sort, final char[] buf, final int off, final int len) { /** * Returns the Java type corresponding to the given type descriptor. - * + * * @param typeDescriptor * a field or method type descriptor. * @return the Java type corresponding to the given type descriptor. @@ -219,7 +219,7 @@ public static Type getType(final String typeDescriptor) { /** * Returns the Java type corresponding to the given internal name. - * + * * @param internalName * an internal name. * @return the Java type corresponding to the given internal name. @@ -232,7 +232,7 @@ public static Type getObjectType(final String internalName) { /** * Returns the Java type corresponding to the given method descriptor. * Equivalent to Type.getType(methodDescriptor). - * + * * @param methodDescriptor * a method descriptor. * @return the Java type corresponding to the given method descriptor. @@ -244,7 +244,7 @@ public static Type getMethodType(final String methodDescriptor) { /** * Returns the Java method type corresponding to the given argument and * return types. - * + * * @param returnType * the return type of the method. * @param argumentTypes @@ -259,7 +259,7 @@ public static Type getMethodType(final Type returnType, /** * Returns the Java type corresponding to the given class. - * + * * @param c * a class. * @return the Java type corresponding to the given class. @@ -292,7 +292,7 @@ public static Type getType(final Class c) { /** * Returns the Java method type corresponding to the given constructor. - * + * * @param c * a {@link Constructor Constructor} object. * @return the Java method type corresponding to the given constructor. @@ -303,7 +303,7 @@ public static Type getType(final Constructor c) { /** * Returns the Java method type corresponding to the given method. - * + * * @param m * a {@link Method Method} object. * @return the Java method type corresponding to the given method. @@ -315,7 +315,7 @@ public static Type getType(final Method m) { /** * Returns the Java types corresponding to the argument types of the given * method descriptor. - * + * * @param methodDescriptor * a method descriptor. * @return the Java types corresponding to the argument types of the given @@ -351,7 +351,7 @@ public static Type[] getArgumentTypes(final String methodDescriptor) { /** * Returns the Java types corresponding to the argument types of the given * method. - * + * * @param method * a method. * @return the Java types corresponding to the argument types of the given @@ -369,7 +369,7 @@ public static Type[] getArgumentTypes(final Method method) { /** * Returns the Java type corresponding to the return type of the given * method descriptor. - * + * * @param methodDescriptor * a method descriptor. * @return the Java type corresponding to the return type of the given @@ -383,7 +383,7 @@ public static Type getReturnType(final String methodDescriptor) { /** * Returns the Java type corresponding to the return type of the given * method. - * + * * @param method * a method. * @return the Java type corresponding to the return type of the given @@ -395,7 +395,7 @@ public static Type getReturnType(final Method method) { /** * Computes the size of the arguments and of the return value of a method. - * + * * @param desc * the descriptor of a method. * @return the size of the arguments of the method (plus one for the @@ -436,7 +436,7 @@ public static int getArgumentsAndReturnSizes(final String desc) { * Returns the Java type corresponding to the given type descriptor. For * method descriptors, buf is supposed to contain nothing more than the * descriptor itself. - * + * * @param buf * a buffer containing a type descriptor. * @param off @@ -494,7 +494,7 @@ private static Type getType(final char[] buf, final int off) { /** * Returns the sort of this Java type. - * + * * @return {@link #VOID VOID}, {@link #BOOLEAN BOOLEAN}, {@link #CHAR CHAR}, * {@link #BYTE BYTE}, {@link #SHORT SHORT}, {@link #INT INT}, * {@link #FLOAT FLOAT}, {@link #LONG LONG}, {@link #DOUBLE DOUBLE}, @@ -508,7 +508,7 @@ public int getSort() { /** * Returns the number of dimensions of this array type. This method should * only be used for an array type. - * + * * @return the number of dimensions of this array type. */ public int getDimensions() { @@ -522,7 +522,7 @@ public int getDimensions() { /** * Returns the type of the elements of this array type. This method should * only be used for an array type. - * + * * @return Returns the type of the elements of this array type. */ public Type getElementType() { @@ -532,7 +532,7 @@ public Type getElementType() { /** * Returns the binary name of the class corresponding to this type. This * method must not be used on method types. - * + * * @return the binary name of the class corresponding to this type. */ public String getClassName() { @@ -573,7 +573,7 @@ public String getClassName() { * array type. The internal name of a class is its fully qualified name (as * returned by Class.getName(), where '.' are replaced by '/'. This method * should only be used for an object or array type. - * + * * @return the internal name of the class corresponding to this object type. */ public String getInternalName() { @@ -583,7 +583,7 @@ public String getInternalName() { /** * Returns the argument types of methods of this type. This method should * only be used for method types. - * + * * @return the argument types of methods of this type. */ public Type[] getArgumentTypes() { @@ -593,7 +593,7 @@ public Type[] getArgumentTypes() { /** * Returns the return type of methods of this type. This method should only * be used for method types. - * + * * @return the return type of methods of this type. */ public Type getReturnType() { @@ -603,7 +603,7 @@ public Type getReturnType() { /** * Returns the size of the arguments and of the return value of methods of * this type. This method should only be used for method types. - * + * * @return the size of the arguments (plus one for the implicit this * argument), argSize, and the size of the return value, retSize, * packed into a single @@ -621,7 +621,7 @@ public int getArgumentsAndReturnSizes() { /** * Returns the descriptor corresponding to this Java type. - * + * * @return the descriptor corresponding to this Java type. */ public String getDescriptor() { @@ -633,7 +633,7 @@ public String getDescriptor() { /** * Returns the descriptor corresponding to the given argument and return * types. - * + * * @param returnType * the return type of the method. * @param argumentTypes @@ -656,7 +656,7 @@ public static String getMethodDescriptor(final Type returnType, /** * Appends the descriptor corresponding to this Java type to the given * string buffer. - * + * * @param buf * the string buffer to which the descriptor must be appended. */ @@ -683,7 +683,7 @@ private void getDescriptor(final StringBuilder buf) { * Returns the internal name of the given class. The internal name of a * class is its fully qualified name, as returned by Class.getName(), where * '.' are replaced by '/'. - * + * * @param c * an object or array class. * @return the internal name of the given class. @@ -694,7 +694,7 @@ public static String getInternalName(final Class c) { /** * Returns the descriptor corresponding to the given Java type. - * + * * @param c * an object class, a primitive class or an array class. * @return the descriptor corresponding to the given class. @@ -707,7 +707,7 @@ public static String getDescriptor(final Class c) { /** * Returns the descriptor corresponding to the given constructor. - * + * * @param c * a {@link Constructor Constructor} object. * @return the descriptor of the given constructor. @@ -724,7 +724,7 @@ public static String getConstructorDescriptor(final Constructor c) { /** * Returns the descriptor corresponding to the given method. - * + * * @param m * a {@link Method Method} object. * @return the descriptor of the given method. @@ -743,7 +743,7 @@ public static String getMethodDescriptor(final Method m) { /** * Appends the descriptor of the given class to the given string buffer. - * + * * @param buf * the string buffer to which the descriptor must be appended. * @param c @@ -799,7 +799,7 @@ private static void getDescriptor(final StringBuilder buf, final Class c) { /** * Returns the size of values of this type. This method must not be used for * method types. - * + * * @return the size of values of this type, i.e., 2 for long and * double, 0 for void and 1 otherwise. */ @@ -811,7 +811,7 @@ public int getSize() { /** * Returns a JVM instruction opcode adapted to this Java type. This method * must not be used for method types. - * + * * @param opcode * a JVM instruction opcode. This opcode must be one of ILOAD, * ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, @@ -838,7 +838,7 @@ public int getOpcode(final int opcode) { /** * Tests if the given object is equal to this type. - * + * * @param o * the object to be compared to this type. * @return true if the given object is equal to this type. @@ -870,7 +870,7 @@ public boolean equals(final Object o) { /** * Returns a hash code value for this type. - * + * * @return a hash code value for this type. */ @Override @@ -886,7 +886,7 @@ public int hashCode() { /** * Returns a string representation of this type. - * + * * @return the descriptor of this type. */ @Override diff --git a/src/main/java/scala/tools/asm/TypePath.java b/src/main/java/scala/tools/asm/TypePath.java index 57888d5..c5478ef 100644 --- a/src/main/java/scala/tools/asm/TypePath.java +++ b/src/main/java/scala/tools/asm/TypePath.java @@ -33,7 +33,7 @@ /** * The path to a type argument, wildcard bound, array element type, or static * inner type within an enclosing type. - * + * * @author Eric Bruneton */ public class TypePath { @@ -74,7 +74,7 @@ public class TypePath { /** * Creates a new type path. - * + * * @param b * the byte array containing the type path in Java class file * format. @@ -88,7 +88,7 @@ public class TypePath { /** * Returns the length of this path. - * + * * @return the length of this path. */ public int getLength() { @@ -97,7 +97,7 @@ public int getLength() { /** * Returns the value of the given step of this path. - * + * * @param index * an index between 0 and {@link #getLength()}, exclusive. * @return {@link #ARRAY_ELEMENT ARRAY_ELEMENT}, {@link #INNER_TYPE @@ -112,7 +112,7 @@ public int getStep(int index) { * Returns the index of the type argument that the given step is stepping * into. This method should only be used for steps whose value is * {@link #TYPE_ARGUMENT TYPE_ARGUMENT}. - * + * * @param index * an index between 0 and {@link #getLength()}, exclusive. * @return the index of the type argument that the given step is stepping @@ -125,7 +125,7 @@ public int getStepArgument(int index) { /** * Converts a type path in string form, in the format used by * {@link #toString()}, into a TypePath object. - * + * * @param typePath * a type path in string form, in the format used by * {@link #toString()}. May be null or empty. diff --git a/src/main/java/scala/tools/asm/TypeReference.java b/src/main/java/scala/tools/asm/TypeReference.java index 4dba4c1..118b0f6 100644 --- a/src/main/java/scala/tools/asm/TypeReference.java +++ b/src/main/java/scala/tools/asm/TypeReference.java @@ -36,7 +36,7 @@ * the referenced type is appearing (e.g. an 'extends', 'implements' or 'throws' * clause, a 'new' instruction, a 'catch' clause, a type cast, a local variable * declaration, etc). - * + * * @author Eric Bruneton */ public class TypeReference { @@ -180,7 +180,7 @@ public class TypeReference { /** * Creates a new TypeReference. - * + * * @param typeRef * the int encoded value of the type reference, as received in a * visit method related to type annotations, like @@ -192,7 +192,7 @@ public TypeReference(int typeRef) { /** * Returns a type reference of the given sort. - * + * * @param sort * {@link #FIELD FIELD}, {@link #METHOD_RETURN METHOD_RETURN}, * {@link #METHOD_RECEIVER METHOD_RECEIVER}, @@ -209,7 +209,7 @@ public static TypeReference newTypeReference(int sort) { /** * Returns a reference to a type parameter of a generic class or method. - * + * * @param sort * {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER} or * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}. @@ -225,7 +225,7 @@ public static TypeReference newTypeParameterReference(int sort, /** * Returns a reference to a type parameter bound of a generic class or * method. - * + * * @param sort * {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER} or * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}. @@ -245,7 +245,7 @@ public static TypeReference newTypeParameterBoundReference(int sort, /** * Returns a reference to the super class or to an interface of the * 'implements' clause of a class. - * + * * @param itfIndex * the index of an interface in the 'implements' clause of a * class, or -1 to reference the super class of the class. @@ -258,10 +258,10 @@ public static TypeReference newSuperTypeReference(int itfIndex) { /** * Returns a reference to the type of a formal parameter of a method. - * + * * @param paramIndex * the formal parameter index. - * + * * @return a reference to the type of the given method formal parameter. */ public static TypeReference newFormalParameterReference(int paramIndex) { @@ -272,10 +272,10 @@ public static TypeReference newFormalParameterReference(int paramIndex) { /** * Returns a reference to the type of an exception, in a 'throws' clause of * a method. - * + * * @param exceptionIndex * the index of an exception in a 'throws' clause of a method. - * + * * @return a reference to the type of the given exception. */ public static TypeReference newExceptionReference(int exceptionIndex) { @@ -285,11 +285,11 @@ public static TypeReference newExceptionReference(int exceptionIndex) { /** * Returns a reference to the type of the exception declared in a 'catch' * clause of a method. - * + * * @param tryCatchBlockIndex * the index of a try catch block (using the order in which they * are visited with visitTryCatchBlock). - * + * * @return a reference to the type of the given exception. */ public static TypeReference newTryCatchReference(int tryCatchBlockIndex) { @@ -300,7 +300,7 @@ public static TypeReference newTryCatchReference(int tryCatchBlockIndex) { /** * Returns a reference to the type of a type argument in a constructor or * method call or reference. - * + * * @param sort * {@link #CAST CAST}, * {@link #CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT @@ -313,7 +313,7 @@ public static TypeReference newTryCatchReference(int tryCatchBlockIndex) { * METHOD_REFERENCE_TYPE_ARGUMENT}. * @param argIndex * the type argument index. - * + * * @return a reference to the type of the given type argument. */ public static TypeReference newTypeArgumentReference(int sort, int argIndex) { @@ -322,7 +322,7 @@ public static TypeReference newTypeArgumentReference(int sort, int argIndex) { /** * Returns the sort of this type reference. - * + * * @return {@link #CLASS_TYPE_PARAMETER CLASS_TYPE_PARAMETER}, * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}, * {@link #CLASS_EXTENDS CLASS_EXTENDS}, @@ -357,7 +357,7 @@ public int getSort() { * {@link #METHOD_TYPE_PARAMETER METHOD_TYPE_PARAMETER}, * {@link #CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} or * {@link #METHOD_TYPE_PARAMETER_BOUND METHOD_TYPE_PARAMETER_BOUND}. - * + * * @return a type parameter index. */ public int getTypeParameterIndex() { @@ -370,7 +370,7 @@ public int getTypeParameterIndex() { * method must only be used for type references whose sort is * {@link #CLASS_TYPE_PARAMETER_BOUND CLASS_TYPE_PARAMETER_BOUND} or * {@link #METHOD_TYPE_PARAMETER_BOUND METHOD_TYPE_PARAMETER_BOUND}. - * + * * @return a type parameter bound index. */ public int getTypeParameterBoundIndex() { @@ -381,7 +381,7 @@ public int getTypeParameterBoundIndex() { * Returns the index of the "super type" of a class that is referenced by * this type reference. This method must only be used for type references * whose sort is {@link #CLASS_EXTENDS CLASS_EXTENDS}. - * + * * @return the index of an interface in the 'implements' clause of a class, * or -1 if this type reference references the type of the super * class. @@ -394,7 +394,7 @@ public int getSuperTypeIndex() { * Returns the index of the formal parameter whose type is referenced by * this type reference. This method must only be used for type references * whose sort is {@link #METHOD_FORMAL_PARAMETER METHOD_FORMAL_PARAMETER}. - * + * * @return a formal parameter index. */ public int getFormalParameterIndex() { @@ -405,7 +405,7 @@ public int getFormalParameterIndex() { * Returns the index of the exception, in a 'throws' clause of a method, * whose type is referenced by this type reference. This method must only be * used for type references whose sort is {@link #THROWS THROWS}. - * + * * @return the index of an exception in the 'throws' clause of a method. */ public int getExceptionIndex() { @@ -417,7 +417,7 @@ public int getExceptionIndex() { * are visited with visitTryCatchBlock), whose 'catch' type is referenced by * this type reference. This method must only be used for type references * whose sort is {@link #EXCEPTION_PARAMETER EXCEPTION_PARAMETER} . - * + * * @return the index of an exception in the 'throws' clause of a method. */ public int getTryCatchBlockIndex() { @@ -433,7 +433,7 @@ public int getTryCatchBlockIndex() { * {@link #CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or * {@link #METHOD_REFERENCE_TYPE_ARGUMENT METHOD_REFERENCE_TYPE_ARGUMENT}. - * + * * @return a type parameter index. */ public int getTypeArgumentIndex() { @@ -443,7 +443,7 @@ public int getTypeArgumentIndex() { /** * Returns the int encoded value of this type reference, suitable for use in * visit methods related to type annotations, like visitTypeAnnotation. - * + * * @return the int encoded value of this type reference. */ public int getValue() { diff --git a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java index e4e207a..80c07bd 100644 --- a/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java +++ b/src/main/java/scala/tools/asm/commons/CodeSizeEvaluator.java @@ -36,7 +36,7 @@ /** * A {@link MethodVisitor} that can be used to approximate method size. - * + * * @author Eugene Kuleshov */ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes { diff --git a/src/main/java/scala/tools/asm/signature/SignatureReader.java b/src/main/java/scala/tools/asm/signature/SignatureReader.java index 3cf9ff4..9c7c388 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureReader.java +++ b/src/main/java/scala/tools/asm/signature/SignatureReader.java @@ -32,7 +32,7 @@ /** * A type signature parser to make a signature visitor visit an existing * signature. - * + * * @author Thomas Hallgren * @author Eric Bruneton */ @@ -45,7 +45,7 @@ public class SignatureReader { /** * Constructs a {@link SignatureReader} for the given signature. - * + * * @param signature * A ClassSignature, MethodTypeSignature, or * FieldTypeSignature. @@ -65,7 +65,7 @@ public SignatureReader(final String signature) { * signature parameter of the * {@link scala.tools.asm.ClassVisitor#visitMethod * ClassVisitor.visitMethod} method). - * + * * @param v * the visitor that must visit this signature. */ @@ -122,7 +122,7 @@ public void accept(final SignatureVisitor v) { * {@link scala.tools.asm.ClassVisitor#visitField ClassVisitor.visitField} * or {@link scala.tools.asm.MethodVisitor#visitLocalVariable * MethodVisitor.visitLocalVariable} methods. - * + * * @param v * the visitor that must visit this signature. */ @@ -132,7 +132,7 @@ public void acceptType(final SignatureVisitor v) { /** * Parses a field type signature and makes the given visitor visit it. - * + * * @param signature * a string containing the signature that must be parsed. * @param pos diff --git a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java index 66a8acb..557ff85 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureVisitor.java +++ b/src/main/java/scala/tools/asm/signature/SignatureVisitor.java @@ -50,7 +50,7 @@ * visitInnerClassType visitTypeArgument* )* visitEnd * ) ) * - * + * * @author Thomas Hallgren * @author Eric Bruneton */ @@ -79,7 +79,7 @@ public abstract class SignatureVisitor { /** * Constructs a new {@link SignatureVisitor}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -93,7 +93,7 @@ public SignatureVisitor(final int api) { /** * Visits a formal type parameter. - * + * * @param name * the name of the formal parameter. */ @@ -102,7 +102,7 @@ public void visitFormalTypeParameter(String name) { /** * Visits the class bound of the last visited formal type parameter. - * + * * @return a non null visitor to visit the signature of the class bound. */ public SignatureVisitor visitClassBound() { @@ -111,7 +111,7 @@ public SignatureVisitor visitClassBound() { /** * Visits an interface bound of the last visited formal type parameter. - * + * * @return a non null visitor to visit the signature of the interface bound. */ public SignatureVisitor visitInterfaceBound() { @@ -120,7 +120,7 @@ public SignatureVisitor visitInterfaceBound() { /** * Visits the type of the super class. - * + * * @return a non null visitor to visit the signature of the super class * type. */ @@ -130,7 +130,7 @@ public SignatureVisitor visitSuperclass() { /** * Visits the type of an interface implemented by the class. - * + * * @return a non null visitor to visit the signature of the interface type. */ public SignatureVisitor visitInterface() { @@ -139,7 +139,7 @@ public SignatureVisitor visitInterface() { /** * Visits the type of a method parameter. - * + * * @return a non null visitor to visit the signature of the parameter type. */ public SignatureVisitor visitParameterType() { @@ -148,7 +148,7 @@ public SignatureVisitor visitParameterType() { /** * Visits the return type of the method. - * + * * @return a non null visitor to visit the signature of the return type. */ public SignatureVisitor visitReturnType() { @@ -157,7 +157,7 @@ public SignatureVisitor visitReturnType() { /** * Visits the type of a method exception. - * + * * @return a non null visitor to visit the signature of the exception type. */ public SignatureVisitor visitExceptionType() { @@ -166,7 +166,7 @@ public SignatureVisitor visitExceptionType() { /** * Visits a signature corresponding to a primitive type. - * + * * @param descriptor * the descriptor of the primitive type, or 'V' for void * . @@ -176,7 +176,7 @@ public void visitBaseType(char descriptor) { /** * Visits a signature corresponding to a type variable. - * + * * @param name * the name of the type variable. */ @@ -185,7 +185,7 @@ public void visitTypeVariable(String name) { /** * Visits a signature corresponding to an array type. - * + * * @return a non null visitor to visit the signature of the array element * type. */ @@ -196,7 +196,7 @@ public SignatureVisitor visitArrayType() { /** * Starts the visit of a signature corresponding to a class or interface * type. - * + * * @param name * the internal name of the class or interface. */ @@ -205,7 +205,7 @@ public void visitClassType(String name) { /** * Visits an inner class. - * + * * @param name * the local name of the inner class in its enclosing class. */ @@ -221,7 +221,7 @@ public void visitTypeArgument() { /** * Visits a type argument of the last visited class or inner class type. - * + * * @param wildcard * '+', '-' or '='. * @return a non null visitor to visit the signature of the type argument. diff --git a/src/main/java/scala/tools/asm/signature/SignatureWriter.java b/src/main/java/scala/tools/asm/signature/SignatureWriter.java index 663dfe0..72c879d 100644 --- a/src/main/java/scala/tools/asm/signature/SignatureWriter.java +++ b/src/main/java/scala/tools/asm/signature/SignatureWriter.java @@ -33,7 +33,7 @@ /** * A signature visitor that generates signatures in string format. - * + * * @author Thomas Hallgren * @author Eric Bruneton */ @@ -193,7 +193,7 @@ public void visitEnd() { /** * Returns the signature that was built by this signature writer. - * + * * @return the signature that was built by this signature writer. */ @Override diff --git a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java index df92d44..2ce0c8b 100644 --- a/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/AbstractInsnNode.java @@ -38,7 +38,7 @@ /** * A node that represents a bytecode instruction. An instruction can appear * at most once in at most one {@link InsnList} at a time. - * + * * @author Eric Bruneton */ public abstract class AbstractInsnNode { @@ -133,7 +133,7 @@ public abstract class AbstractInsnNode { * only used for real instructions (i.e. not for labels, frames, or line * number nodes). This list is a list of {@link TypeAnnotationNode} objects. * May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ @@ -144,7 +144,7 @@ public abstract class AbstractInsnNode { * only used for real instructions (i.e. not for labels, frames, or line * number nodes). This list is a list of {@link TypeAnnotationNode} objects. * May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ @@ -170,7 +170,7 @@ public abstract class AbstractInsnNode { /** * Constructs a new {@link AbstractInsnNode}. - * + * * @param opcode * the opcode of the instruction to be constructed. */ @@ -181,7 +181,7 @@ protected AbstractInsnNode(final int opcode) { /** * Returns the opcode of this instruction. - * + * * @return the opcode of this instruction. */ public int getOpcode() { @@ -190,7 +190,7 @@ public int getOpcode() { /** * Returns the type of this instruction. - * + * * @return the type of this instruction, i.e. one the constants defined in * this class. */ @@ -199,7 +199,7 @@ public int getOpcode() { /** * Returns the previous instruction in the list to which this instruction * belongs, if any. - * + * * @return the previous instruction in the list to which this instruction * belongs, if any. May be null. */ @@ -210,7 +210,7 @@ public AbstractInsnNode getPrevious() { /** * Returns the next instruction in the list to which this instruction * belongs, if any. - * + * * @return the next instruction in the list to which this instruction * belongs, if any. May be null. */ @@ -220,7 +220,7 @@ public AbstractInsnNode getNext() { /** * Makes the given code visitor visit this instruction. - * + * * @param cv * a code visitor. */ @@ -228,7 +228,7 @@ public AbstractInsnNode getNext() { /** * Makes the given visitor visit the annotations of this instruction. - * + * * @param mv * a method visitor. */ @@ -251,7 +251,7 @@ protected final void acceptAnnotations(final MethodVisitor mv) { /** * Returns a copy of this instruction. - * + * * @param labels * a map from LabelNodes to cloned LabelNodes. * @return a copy of this instruction. The returned instruction does not @@ -262,7 +262,7 @@ public abstract AbstractInsnNode clone( /** * Returns the clone of the given label. - * + * * @param label * a label. * @param map @@ -276,7 +276,7 @@ static LabelNode clone(final LabelNode label, /** * Returns the clones of the given labels. - * + * * @param labels * a list of labels. * @param map @@ -294,7 +294,7 @@ static LabelNode[] clone(final List labels, /** * Clones the annotations of the given instruction into this instruction. - * + * * @param insn * the source instruction. * @return this instruction. diff --git a/src/main/java/scala/tools/asm/tree/AnnotationNode.java b/src/main/java/scala/tools/asm/tree/AnnotationNode.java index 1ac46f6..8cbee05 100644 --- a/src/main/java/scala/tools/asm/tree/AnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/AnnotationNode.java @@ -37,7 +37,7 @@ /** * A node that represents an annotationn. - * + * * @author Eric Bruneton */ public class AnnotationNode extends AnnotationVisitor { @@ -64,7 +64,7 @@ public class AnnotationNode extends AnnotationVisitor { * Constructs a new {@link AnnotationNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #AnnotationNode(int, String)} version. - * + * * @param desc * the class descriptor of the annotation class. * @throws IllegalStateException @@ -79,7 +79,7 @@ public AnnotationNode(final String desc) { /** * Constructs a new {@link AnnotationNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -93,7 +93,7 @@ public AnnotationNode(final int api, final String desc) { /** * Constructs a new {@link AnnotationNode} to visit an array value. - * + * * @param values * where the visited values must be stored. */ @@ -169,7 +169,7 @@ public void visitEnd() { * version. This methods checks that this node, and all its nodes * recursively, do not contain elements that were introduced in more recent * versions of the ASM API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -180,7 +180,7 @@ public void check(final int api) { /** * Makes the given visitor visit this annotation. - * + * * @param av * an annotation visitor. Maybe null. */ @@ -199,7 +199,7 @@ public void accept(final AnnotationVisitor av) { /** * Makes the given visitor visit a given annotation value. - * + * * @param av * an annotation visitor. Maybe null. * @param name diff --git a/src/main/java/scala/tools/asm/tree/ClassNode.java b/src/main/java/scala/tools/asm/tree/ClassNode.java index 2c68305..304b4ec 100644 --- a/src/main/java/scala/tools/asm/tree/ClassNode.java +++ b/src/main/java/scala/tools/asm/tree/ClassNode.java @@ -43,7 +43,7 @@ /** * A node that represents a class. - * + * * @author Eric Bruneton */ public class ClassNode extends ClassVisitor { @@ -118,7 +118,7 @@ public class ClassNode extends ClassVisitor { /** * The runtime visible annotations of this class. This list is a list of * {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label visible */ @@ -127,7 +127,7 @@ public class ClassNode extends ClassVisitor { /** * The runtime invisible annotations of this class. This list is a list of * {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label invisible */ @@ -136,7 +136,7 @@ public class ClassNode extends ClassVisitor { /** * The runtime visible type annotations of this class. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ @@ -145,7 +145,7 @@ public class ClassNode extends ClassVisitor { /** * The runtime invisible type annotations of this class. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ @@ -154,7 +154,7 @@ public class ClassNode extends ClassVisitor { /** * The non standard attributes of this class. This list is a list of * {@link Attribute} objects. May be null. - * + * * @associates scala.tools.asm.Attribute */ public List attrs; @@ -162,7 +162,7 @@ public class ClassNode extends ClassVisitor { /** * Informations about the inner classes of this class. This list is a list * of {@link InnerClassNode} objects. - * + * * @associates scala.tools.asm.tree.InnerClassNode */ public List innerClasses; @@ -170,7 +170,7 @@ public class ClassNode extends ClassVisitor { /** * The fields of this class. This list is a list of {@link FieldNode} * objects. - * + * * @associates scala.tools.asm.tree.FieldNode */ public List fields; @@ -178,7 +178,7 @@ public class ClassNode extends ClassVisitor { /** * The methods of this class. This list is a list of {@link MethodNode} * objects. - * + * * @associates scala.tools.asm.tree.MethodNode */ public List methods; @@ -187,7 +187,7 @@ public class ClassNode extends ClassVisitor { * Constructs a new {@link ClassNode}. Subclasses must not use this * constructor. Instead, they must use the {@link #ClassNode(int)} * version. - * + * * @throws IllegalStateException * If a subclass calls this constructor. */ @@ -200,7 +200,7 @@ public ClassNode() { /** * Constructs a new {@link ClassNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -327,7 +327,7 @@ public void visitEnd() { * This methods checks that this node, and all its nodes recursively, do not * contain elements that were introduced in more recent versions of the ASM * API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -353,7 +353,7 @@ public void check(final int api) { /** * Makes the given class visitor visit this class. - * + * * @param cv * a class visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java index 0e2892b..c027de1 100644 --- a/src/main/java/scala/tools/asm/tree/FieldInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldInsnNode.java @@ -36,7 +36,7 @@ /** * A node that represents a field instruction. A field instruction is an * instruction that loads or stores the value of a field of an object. - * + * * @author Eric Bruneton */ public class FieldInsnNode extends AbstractInsnNode { @@ -59,7 +59,7 @@ public class FieldInsnNode extends AbstractInsnNode { /** * Constructs a new {@link FieldInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. @@ -82,7 +82,7 @@ public FieldInsnNode(final int opcode, final String owner, /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be GETSTATIC, * PUTSTATIC, GETFIELD or PUTFIELD. diff --git a/src/main/java/scala/tools/asm/tree/FieldNode.java b/src/main/java/scala/tools/asm/tree/FieldNode.java index ea85477..3fb14da 100644 --- a/src/main/java/scala/tools/asm/tree/FieldNode.java +++ b/src/main/java/scala/tools/asm/tree/FieldNode.java @@ -41,7 +41,7 @@ /** * A node that represents a field. - * + * * @author Eric Bruneton */ public class FieldNode extends FieldVisitor { @@ -77,7 +77,7 @@ public class FieldNode extends FieldVisitor { /** * The runtime visible annotations of this field. This list is a list of * {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label visible */ @@ -86,7 +86,7 @@ public class FieldNode extends FieldVisitor { /** * The runtime invisible annotations of this field. This list is a list of * {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label invisible */ @@ -95,7 +95,7 @@ public class FieldNode extends FieldVisitor { /** * The runtime visible type annotations of this field. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ @@ -104,7 +104,7 @@ public class FieldNode extends FieldVisitor { /** * The runtime invisible type annotations of this field. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ @@ -113,7 +113,7 @@ public class FieldNode extends FieldVisitor { /** * The non standard attributes of this field. This list is a list of * {@link Attribute} objects. May be null. - * + * * @associates scala.tools.asm.Attribute */ public List attrs; @@ -122,7 +122,7 @@ public class FieldNode extends FieldVisitor { * Constructs a new {@link FieldNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #FieldNode(int, int, String, String, String, Object)} version. - * + * * @param access * the field's access flags (see * {@link scala.tools.asm.Opcodes}). This parameter also @@ -153,7 +153,7 @@ public FieldNode(final int access, final String name, final String desc, /** * Constructs a new {@link FieldNode}. Subclasses must not use this * constructor. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -245,7 +245,7 @@ public void visitEnd() { * This methods checks that this node, and all its nodes recursively, do not * contain elements that were introduced in more recent versions of the ASM * API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -265,7 +265,7 @@ public void check(final int api) { /** * Makes the given class visitor visit this field. - * + * * @param cv * a class visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/FrameNode.java b/src/main/java/scala/tools/asm/tree/FrameNode.java index e4c7e7d..f13fc66 100644 --- a/src/main/java/scala/tools/asm/tree/FrameNode.java +++ b/src/main/java/scala/tools/asm/tree/FrameNode.java @@ -48,7 +48,7 @@ *
* (*) this is mandatory only for classes whose version is greater than or equal * to {@link Opcodes#V1_6 V1_6}. - * + * * @author Eric Bruneton */ public class FrameNode extends AbstractInsnNode { @@ -83,7 +83,7 @@ private FrameNode() { /** * Constructs a new {@link FrameNode}. - * + * * @param type * the type of this frame. Must be {@link Opcodes#F_NEW} for * expanded frames, or {@link Opcodes#F_FULL}, @@ -136,7 +136,7 @@ public int getType() { /** * Makes the given visitor visit this stack map frame. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/IincInsnNode.java b/src/main/java/scala/tools/asm/tree/IincInsnNode.java index 88340d9..db50eab 100644 --- a/src/main/java/scala/tools/asm/tree/IincInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IincInsnNode.java @@ -36,7 +36,7 @@ /** * A node that represents an IINC instruction. - * + * * @author Eric Bruneton */ public class IincInsnNode extends AbstractInsnNode { @@ -53,7 +53,7 @@ public class IincInsnNode extends AbstractInsnNode { /** * Constructs a new {@link IincInsnNode}. - * + * * @param var * index of the local variable to be incremented. * @param incr diff --git a/src/main/java/scala/tools/asm/tree/InnerClassNode.java b/src/main/java/scala/tools/asm/tree/InnerClassNode.java index 130c5d7..aa3810c 100644 --- a/src/main/java/scala/tools/asm/tree/InnerClassNode.java +++ b/src/main/java/scala/tools/asm/tree/InnerClassNode.java @@ -33,7 +33,7 @@ /** * A node that represents an inner class. - * + * * @author Eric Bruneton */ public class InnerClassNode { @@ -65,7 +65,7 @@ public class InnerClassNode { /** * Constructs a new {@link InnerClassNode}. - * + * * @param name * the internal name of an inner class (see * {@link scala.tools.asm.Type#getInternalName() @@ -91,7 +91,7 @@ public InnerClassNode(final String name, final String outerName, /** * Makes the given class visitor visit this inner class. - * + * * @param cv * a class visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/InsnList.java b/src/main/java/scala/tools/asm/tree/InsnList.java index fa6ceeb..698dd7a 100644 --- a/src/main/java/scala/tools/asm/tree/InsnList.java +++ b/src/main/java/scala/tools/asm/tree/InsnList.java @@ -63,7 +63,7 @@ public class InsnList { /** * Returns the number of instructions in this list. - * + * * @return the number of instructions in this list. */ public int size() { @@ -72,7 +72,7 @@ public int size() { /** * Returns the first instruction in this list. - * + * * @return the first instruction in this list, or null if the list * is empty. */ @@ -82,7 +82,7 @@ public AbstractInsnNode getFirst() { /** * Returns the last instruction in this list. - * + * * @return the last instruction in this list, or null if the list * is empty. */ @@ -95,7 +95,7 @@ public AbstractInsnNode getLast() { * of the instructions in this list to avoid scanning the whole list each * time it is called. Once the cache is built, this method run in constant * time. This cache is invalidated by all the methods that modify the list. - * + * * @param index * the index of the instruction that must be returned. * @return the instruction whose index is given. @@ -116,7 +116,7 @@ public AbstractInsnNode get(final int index) { * Returns true if the given instruction belongs to this list. This * method always scans the instructions of this list until it finds the * given instruction or reaches the end of the list. - * + * * @param insn * an instruction. * @return true if the given instruction belongs to this list. @@ -135,7 +135,7 @@ public boolean contains(final AbstractInsnNode insn) { * list each time it is called. Once the cache is built, this method run in * constant time. The cache is invalidated by all the methods that modify * the list. - * + * * @param insn * an instruction of this list. * @return the index of the given instruction in this list. The result of @@ -152,7 +152,7 @@ public int indexOf(final AbstractInsnNode insn) { /** * Makes the given visitor visit all of the instructions in this list. - * + * * @param mv * the method visitor that must visit the instructions. */ @@ -166,7 +166,7 @@ public void accept(final MethodVisitor mv) { /** * Returns an iterator over the instructions in this list. - * + * * @return an iterator over the instructions in this list. */ public ListIterator iterator() { @@ -175,10 +175,10 @@ public ListIterator iterator() { /** * Returns an iterator over the instructions in this list. - * + * * @param index * index of instruction for the iterator to start at - * + * * @return an iterator over the instructions in this list. */ @SuppressWarnings("unchecked") @@ -188,7 +188,7 @@ public ListIterator iterator(int index) { /** * Returns an array containing all of the instructions in this list. - * + * * @return an array containing all of the instructions in this list. */ public AbstractInsnNode[] toArray() { @@ -205,7 +205,7 @@ public AbstractInsnNode[] toArray() { /** * Replaces an instruction of this list with another instruction. - * + * * @param location * an instruction of this list. * @param insn @@ -241,7 +241,7 @@ public void set(final AbstractInsnNode location, final AbstractInsnNode insn) { /** * Adds the given instruction to the end of this list. - * + * * @param insn * an instruction, which must not belong to any * {@link InsnList}. @@ -262,7 +262,7 @@ public void add(final AbstractInsnNode insn) { /** * Adds the given instructions to the end of this list. - * + * * @param insns * an instruction list, which is cleared during the process. This * list must be different from 'this'. @@ -287,7 +287,7 @@ public void add(final InsnList insns) { /** * Inserts the given instruction at the begining of this list. - * + * * @param insn * an instruction, which must not belong to any * {@link InsnList}. @@ -308,7 +308,7 @@ public void insert(final AbstractInsnNode insn) { /** * Inserts the given instructions at the begining of this list. - * + * * @param insns * an instruction list, which is cleared during the process. This * list must be different from 'this'. @@ -333,7 +333,7 @@ public void insert(final InsnList insns) { /** * Inserts the given instruction after the specified instruction. - * + * * @param location * an instruction of this list after which insn must be * inserted. @@ -359,7 +359,7 @@ public void insert(final AbstractInsnNode location, /** * Inserts the given instructions after the specified instruction. - * + * * @param location * an instruction of this list after which the * instructions must be inserted. @@ -389,7 +389,7 @@ public void insert(final AbstractInsnNode location, final InsnList insns) { /** * Inserts the given instruction before the specified instruction. - * + * * @param location * an instruction of this list before which insn must be * inserted. @@ -415,7 +415,7 @@ public void insertBefore(final AbstractInsnNode location, /** * Inserts the given instructions before the specified instruction. - * + * * @param location * an instruction of this list before which the * instructions must be inserted. @@ -446,7 +446,7 @@ public void insertBefore(final AbstractInsnNode location, /** * Removes the given instruction from this list. - * + * * @param insn * the instruction of this list that must be removed. */ @@ -479,7 +479,7 @@ public void remove(final AbstractInsnNode insn) { /** * Removes all of the instructions of this list. - * + * * @param mark * if the instructions must be marked as no longer belonging to * any {@link InsnList}. @@ -622,7 +622,7 @@ public void set(Object o) { if (remove == prev) { prev = (AbstractInsnNode) o; } else { - next = (AbstractInsnNode) o; + next = (AbstractInsnNode) o; } } else { throw new IllegalStateException(); diff --git a/src/main/java/scala/tools/asm/tree/InsnNode.java b/src/main/java/scala/tools/asm/tree/InsnNode.java index 71bd5e3..f531392 100644 --- a/src/main/java/scala/tools/asm/tree/InsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InsnNode.java @@ -35,14 +35,14 @@ /** * A node that represents a zero operand instruction. - * + * * @author Eric Bruneton */ public class InsnNode extends AbstractInsnNode { /** * Constructs a new {@link InsnNode}. - * + * * @param opcode * the opcode of the instruction to be constructed. This opcode * must be NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, @@ -71,7 +71,7 @@ public int getType() { /** * Makes the given visitor visit this instruction. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/IntInsnNode.java b/src/main/java/scala/tools/asm/tree/IntInsnNode.java index 1212dcb..6bbe8d8 100644 --- a/src/main/java/scala/tools/asm/tree/IntInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/IntInsnNode.java @@ -35,7 +35,7 @@ /** * A node that represents an instruction with a single int operand. - * + * * @author Eric Bruneton */ public class IntInsnNode extends AbstractInsnNode { @@ -47,7 +47,7 @@ public class IntInsnNode extends AbstractInsnNode { /** * Constructs a new {@link IntInsnNode}. - * + * * @param opcode * the opcode of the instruction to be constructed. This opcode * must be BIPUSH, SIPUSH or NEWARRAY. @@ -61,7 +61,7 @@ public IntInsnNode(final int opcode, final int operand) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be BIPUSH, SIPUSH * or NEWARRAY. diff --git a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java index dd21e11..d7fb3ee 100644 --- a/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/InvokeDynamicInsnNode.java @@ -37,7 +37,7 @@ /** * A node that represents an invokedynamic instruction. - * + * * @author Remi Forax */ public class InvokeDynamicInsnNode extends AbstractInsnNode { @@ -64,7 +64,7 @@ public class InvokeDynamicInsnNode extends AbstractInsnNode { /** * Constructs a new {@link InvokeDynamicInsnNode}. - * + * * @param name * invokedynamic name. * @param desc diff --git a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java index 4fe2a16..8b8a769 100644 --- a/src/main/java/scala/tools/asm/tree/JumpInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/JumpInsnNode.java @@ -36,7 +36,7 @@ /** * A node that represents a jump instruction. A jump instruction is an * instruction that may jump to another instruction. - * + * * @author Eric Bruneton */ public class JumpInsnNode extends AbstractInsnNode { @@ -49,7 +49,7 @@ public class JumpInsnNode extends AbstractInsnNode { /** * Constructs a new {@link JumpInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, @@ -67,7 +67,7 @@ public JumpInsnNode(final int opcode, final LabelNode label) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be IFEQ, IFNE, * IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, diff --git a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java index 92b6f70..c441081 100644 --- a/src/main/java/scala/tools/asm/tree/LdcInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LdcInsnNode.java @@ -36,7 +36,7 @@ /** * A node that represents an LDC instruction. - * + * * @author Eric Bruneton */ public class LdcInsnNode extends AbstractInsnNode { @@ -50,7 +50,7 @@ public class LdcInsnNode extends AbstractInsnNode { /** * Constructs a new {@link LdcInsnNode}. - * + * * @param cst * the constant to be loaded on the stack. This parameter must be * a non null {@link Integer}, a {@link Float}, a {@link Long}, a diff --git a/src/main/java/scala/tools/asm/tree/LineNumberNode.java b/src/main/java/scala/tools/asm/tree/LineNumberNode.java index 0e3fb48..9947aa7 100644 --- a/src/main/java/scala/tools/asm/tree/LineNumberNode.java +++ b/src/main/java/scala/tools/asm/tree/LineNumberNode.java @@ -36,7 +36,7 @@ /** * A node that represents a line number declaration. These nodes are pseudo * instruction nodes in order to be inserted in an instruction list. - * + * * @author Eric Bruneton */ public class LineNumberNode extends AbstractInsnNode { @@ -54,7 +54,7 @@ public class LineNumberNode extends AbstractInsnNode { /** * Constructs a new {@link LineNumberNode}. - * + * * @param line * a line number. This number refers to the source file from * which the class was compiled. diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java index 638b60b..d05b808 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableAnnotationNode.java @@ -42,7 +42,7 @@ /** * A node that represents a type annotation on a local or resource variable. - * + * * @author Eric Bruneton */ public class LocalVariableAnnotationNode extends TypeAnnotationNode { @@ -71,7 +71,7 @@ public class LocalVariableAnnotationNode extends TypeAnnotationNode { * not use this constructor. Instead, they must use the * {@link #LocalVariableAnnotationNode(int, TypePath, LabelNode[], LabelNode[], int[], String)} * version. - * + * * @param typeRef * a reference to the annotated type. See {@link TypeReference}. * @param typePath @@ -98,7 +98,7 @@ public LocalVariableAnnotationNode(int typeRef, TypePath typePath, /** * Constructs a new {@link LocalVariableAnnotationNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -136,7 +136,7 @@ public LocalVariableAnnotationNode(int api, int typeRef, TypePath typePath, /** * Makes the given visitor visit this type annotation. - * + * * @param mv * the visitor that must visit this annotation. * @param visible diff --git a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java index d58f073..0d8e273 100644 --- a/src/main/java/scala/tools/asm/tree/LocalVariableNode.java +++ b/src/main/java/scala/tools/asm/tree/LocalVariableNode.java @@ -33,7 +33,7 @@ /** * A node that represents a local variable declaration. - * + * * @author Eric Bruneton */ public class LocalVariableNode { @@ -72,7 +72,7 @@ public class LocalVariableNode { /** * Constructs a new {@link LocalVariableNode}. - * + * * @param name * the name of a local variable. * @param desc @@ -101,7 +101,7 @@ public LocalVariableNode(final String name, final String desc, /** * Makes the given visitor visit this local variable declaration. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java index d73eeee..b4e4e8c 100644 --- a/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/LookupSwitchInsnNode.java @@ -40,7 +40,7 @@ /** * A node that represents a LOOKUPSWITCH instruction. - * + * * @author Eric Bruneton */ public class LookupSwitchInsnNode extends AbstractInsnNode { @@ -63,7 +63,7 @@ public class LookupSwitchInsnNode extends AbstractInsnNode { /** * Constructs a new {@link LookupSwitchInsnNode}. - * + * * @param dflt * beginning of the default handler block. * @param keys diff --git a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java index 5d06ec8..5f615ab 100644 --- a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java @@ -37,7 +37,7 @@ /** * A node that represents a method instruction. A method instruction is an * instruction that invokes a method. - * + * * @author Eric Bruneton */ public class MethodInsnNode extends AbstractInsnNode { @@ -65,7 +65,7 @@ public class MethodInsnNode extends AbstractInsnNode { /** * Constructs a new {@link MethodInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or @@ -87,7 +87,7 @@ public MethodInsnNode(final int opcode, final String owner, /** * Constructs a new {@link MethodInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or @@ -114,7 +114,7 @@ public MethodInsnNode(final int opcode, final String owner, /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be INVOKEVIRTUAL, * INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE. diff --git a/src/main/java/scala/tools/asm/tree/MethodNode.java b/src/main/java/scala/tools/asm/tree/MethodNode.java index 06ff7cb..496d210 100644 --- a/src/main/java/scala/tools/asm/tree/MethodNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodNode.java @@ -45,7 +45,7 @@ /** * A node that represents a method. - * + * * @author Eric Bruneton */ public class MethodNode extends MethodVisitor { @@ -86,7 +86,7 @@ public class MethodNode extends MethodVisitor { /** * The runtime visible annotations of this method. This list is a list of * {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label visible */ @@ -95,7 +95,7 @@ public class MethodNode extends MethodVisitor { /** * The runtime invisible annotations of this method. This list is a list of * {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label invisible */ @@ -104,7 +104,7 @@ public class MethodNode extends MethodVisitor { /** * The runtime visible type annotations of this method. This list is a list * of {@link TypeAnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ @@ -113,7 +113,7 @@ public class MethodNode extends MethodVisitor { /** * The runtime invisible type annotations of this method. This list is a * list of {@link TypeAnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ @@ -122,7 +122,7 @@ public class MethodNode extends MethodVisitor { /** * The non standard attributes of this method. This list is a list of * {@link Attribute} objects. May be null. - * + * * @associates scala.tools.asm.Attribute */ public List attrs; @@ -140,7 +140,7 @@ public class MethodNode extends MethodVisitor { /** * The runtime visible parameter annotations of this method. These lists are * lists of {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label invisible parameters */ @@ -149,7 +149,7 @@ public class MethodNode extends MethodVisitor { /** * The runtime invisible parameter annotations of this method. These lists * are lists of {@link AnnotationNode} objects. May be null. - * + * * @associates scala.tools.asm.tree.AnnotationNode * @label visible parameters */ @@ -158,7 +158,7 @@ public class MethodNode extends MethodVisitor { /** * The instructions of this method. This list is a list of * {@link AbstractInsnNode} objects. - * + * * @associates scala.tools.asm.tree.AbstractInsnNode * @label instructions */ @@ -167,7 +167,7 @@ public class MethodNode extends MethodVisitor { /** * The try catch blocks of this method. This list is a list of * {@link TryCatchBlockNode} objects. - * + * * @associates scala.tools.asm.tree.TryCatchBlockNode */ public List tryCatchBlocks; @@ -185,7 +185,7 @@ public class MethodNode extends MethodVisitor { /** * The local variables of this method. This list is a list of * {@link LocalVariableNode} objects. May be null - * + * * @associates scala.tools.asm.tree.LocalVariableNode */ public List localVariables; @@ -193,7 +193,7 @@ public class MethodNode extends MethodVisitor { /** * The visible local variable annotations of this method. This list is a * list of {@link LocalVariableAnnotationNode} objects. May be null - * + * * @associates scala.tools.asm.tree.LocalVariableAnnotationNode */ public List visibleLocalVariableAnnotations; @@ -201,7 +201,7 @@ public class MethodNode extends MethodVisitor { /** * The invisible local variable annotations of this method. This list is a * list of {@link LocalVariableAnnotationNode} objects. May be null - * + * * @associates scala.tools.asm.tree.LocalVariableAnnotationNode */ public List invisibleLocalVariableAnnotations; @@ -215,7 +215,7 @@ public class MethodNode extends MethodVisitor { * Constructs an uninitialized {@link MethodNode}. Subclasses must not * use this constructor. Instead, they must use the * {@link #MethodNode(int)} version. - * + * * @throws IllegalStateException * If a subclass calls this constructor. */ @@ -228,7 +228,7 @@ public MethodNode() { /** * Constructs an uninitialized {@link MethodNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -242,7 +242,7 @@ public MethodNode(final int api) { * Constructs a new {@link MethodNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #MethodNode(int, int, String, String, String, String[])} version. - * + * * @param access * the method's access flags (see {@link Opcodes}). This * parameter also indicates if the method is synthetic and/or @@ -270,7 +270,7 @@ public MethodNode(final int access, final String name, final String desc, /** * Constructs a new {@link MethodNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -616,7 +616,7 @@ public void visitEnd() { * LabelNode if necessary. The default implementation of this method uses * the {@link Label#info} field to store associations between labels and * label nodes. - * + * * @param l * a Label. * @return the LabelNode corresponding to l. @@ -657,7 +657,7 @@ private Object[] getLabelNodes(final Object[] objs) { * version. This methods checks that this node, and all its nodes * recursively, do not contain elements that were introduced in more recent * versions of the ASM API than the given version. - * + * * @param api * an ASM API version. Must be one of {@link Opcodes#ASM4} or * {@link Opcodes#ASM5}. @@ -714,7 +714,7 @@ public void check(final int api) { /** * Makes the given class visitor visit this method. - * + * * @param cv * a class visitor. */ @@ -730,7 +730,7 @@ public void accept(final ClassVisitor cv) { /** * Makes the given method visitor visit this method. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java index 40b8e7c..cff5345 100644 --- a/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MultiANewArrayInsnNode.java @@ -36,7 +36,7 @@ /** * A node that represents a MULTIANEWARRAY instruction. - * + * * @author Eric Bruneton */ public class MultiANewArrayInsnNode extends AbstractInsnNode { @@ -53,7 +53,7 @@ public class MultiANewArrayInsnNode extends AbstractInsnNode { /** * Constructs a new {@link MultiANewArrayInsnNode}. - * + * * @param desc * an array type descriptor (see {@link scala.tools.asm.Type}). * @param dims diff --git a/src/main/java/scala/tools/asm/tree/ParameterNode.java b/src/main/java/scala/tools/asm/tree/ParameterNode.java index cb5f798..a3e55d5 100644 --- a/src/main/java/scala/tools/asm/tree/ParameterNode.java +++ b/src/main/java/scala/tools/asm/tree/ParameterNode.java @@ -33,7 +33,7 @@ /** * A node that represents a parameter access and name. - * + * * @author Remi Forax */ public class ParameterNode { @@ -51,7 +51,7 @@ public class ParameterNode { /** * Constructs a new {@link ParameterNode}. - * + * * @param access * The parameter's access flags. Valid values are * ACC_FINAL, ACC_SYNTHETIC or/and @@ -66,7 +66,7 @@ public ParameterNode(final String name, final int access) { /** * Makes the given visitor visit this parameter declaration. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java index 1bbc870..5d84f1a 100644 --- a/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TableSwitchInsnNode.java @@ -40,7 +40,7 @@ /** * A node that represents a TABLESWITCH instruction. - * + * * @author Eric Bruneton */ public class TableSwitchInsnNode extends AbstractInsnNode { @@ -68,7 +68,7 @@ public class TableSwitchInsnNode extends AbstractInsnNode { /** * Constructs a new {@link TableSwitchInsnNode}. - * + * * @param min * the minimum key value. * @param max diff --git a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java index 0d172f4..c639b9a 100644 --- a/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java +++ b/src/main/java/scala/tools/asm/tree/TryCatchBlockNode.java @@ -35,7 +35,7 @@ /** * A node that represents a try catch block. - * + * * @author Eric Bruneton */ public class TryCatchBlockNode { @@ -65,7 +65,7 @@ public class TryCatchBlockNode { * The runtime visible type annotations on the exception handler type. This * list is a list of {@link TypeAnnotationNode} objects. May be * null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label visible */ @@ -75,7 +75,7 @@ public class TryCatchBlockNode { * The runtime invisible type annotations on the exception handler type. * This list is a list of {@link TypeAnnotationNode} objects. May be * null. - * + * * @associates scala.tools.asm.tree.TypeAnnotationNode * @label invisible */ @@ -83,7 +83,7 @@ public class TryCatchBlockNode { /** * Constructs a new {@link TryCatchBlockNode}. - * + * * @param start * beginning of the exception handler's scope (inclusive). * @param end @@ -107,7 +107,7 @@ public TryCatchBlockNode(final LabelNode start, final LabelNode end, * Updates the index of this try catch block in the method's list of try * catch block nodes. This index maybe stored in the 'target' field of the * type annotations of this block. - * + * * @param index * the new index of this try catch block in the method's list of * try catch block nodes. @@ -128,7 +128,7 @@ public void updateIndex(final int index) { /** * Makes the given visitor visit this try catch block. - * + * * @param mv * a method visitor. */ diff --git a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java index c5957f9..73b2962 100644 --- a/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeAnnotationNode.java @@ -35,7 +35,7 @@ /** * A node that represents a type annotationn. - * + * * @author Eric Bruneton */ public class TypeAnnotationNode extends AnnotationNode { @@ -56,7 +56,7 @@ public class TypeAnnotationNode extends AnnotationNode { * Constructs a new {@link AnnotationNode}. Subclasses must not use this * constructor. Instead, they must use the * {@link #TypeAnnotationNode(int, int, TypePath, String)} version. - * + * * @param typeRef * a reference to the annotated type. See {@link TypeReference}. * @param typePath @@ -78,7 +78,7 @@ public TypeAnnotationNode(final int typeRef, final TypePath typePath, /** * Constructs a new {@link AnnotationNode}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. diff --git a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java index 894f9c0..90172a8 100644 --- a/src/main/java/scala/tools/asm/tree/TypeInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/TypeInsnNode.java @@ -36,7 +36,7 @@ /** * A node that represents a type instruction. A type instruction is an * instruction that takes a type descriptor as parameter. - * + * * @author Eric Bruneton */ public class TypeInsnNode extends AbstractInsnNode { @@ -49,7 +49,7 @@ public class TypeInsnNode extends AbstractInsnNode { /** * Constructs a new {@link TypeInsnNode}. - * + * * @param opcode * the opcode of the type instruction to be constructed. This * opcode must be NEW, ANEWARRAY, CHECKCAST or INSTANCEOF. @@ -64,7 +64,7 @@ public TypeInsnNode(final int opcode, final String desc) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be NEW, * ANEWARRAY, CHECKCAST or INSTANCEOF. diff --git a/src/main/java/scala/tools/asm/tree/VarInsnNode.java b/src/main/java/scala/tools/asm/tree/VarInsnNode.java index 76b5c38..1d52bf0 100644 --- a/src/main/java/scala/tools/asm/tree/VarInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/VarInsnNode.java @@ -37,7 +37,7 @@ * A node that represents a local variable instruction. A local variable * instruction is an instruction that loads or stores the value of a local * variable. - * + * * @author Eric Bruneton */ public class VarInsnNode extends AbstractInsnNode { @@ -50,7 +50,7 @@ public class VarInsnNode extends AbstractInsnNode { /** * Constructs a new {@link VarInsnNode}. - * + * * @param opcode * the opcode of the local variable instruction to be * constructed. This opcode must be ILOAD, LLOAD, FLOAD, DLOAD, @@ -66,7 +66,7 @@ public VarInsnNode(final int opcode, final int var) { /** * Sets the opcode of this instruction. - * + * * @param opcode * the new instruction opcode. This opcode must be ILOAD, LLOAD, * FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or diff --git a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java index a4bf933..1c46a85 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java @@ -50,10 +50,10 @@ /** * A semantic bytecode analyzer. This class does not fully check that JSR and * RET instructions are valid. - * + * * @param * type of the Value used for the analysis. - * + * * @author Eric Bruneton */ public class Analyzer implements Opcodes { @@ -78,7 +78,7 @@ public class Analyzer implements Opcodes { /** * Constructs a new {@link Analyzer}. - * + * * @param interpreter * the interpreter to be used to symbolically interpret the * bytecode instructions. @@ -89,7 +89,7 @@ public Analyzer(final Interpreter interpreter) { /** * Analyzes the given method. - * + * * @param owner * the internal name of the class to which the method belongs. * @param m @@ -371,7 +371,7 @@ private void findSubroutine(int insn, final Subroutine sub, /** * Returns the symbolic stack frame for each instruction of the last * recently analyzed method. - * + * * @return the symbolic state of the execution stack frame at each bytecode * instruction of the method. The size of the returned array is * equal to the number of instructions (and labels) of the method. A @@ -385,7 +385,7 @@ public Frame[] getFrames() { /** * Returns the exception handlers for the given instruction. - * + * * @param insn * the index of an instruction of the last recently analyzed * method. @@ -399,7 +399,7 @@ public List getHandlers(final int insn) { * Initializes this analyzer. This method is called just before the * execution of control flow analysis loop in #analyze. The default * implementation of this method does nothing. - * + * * @param owner * the internal name of the class to which the method belongs. * @param m @@ -412,7 +412,7 @@ protected void init(String owner, MethodNode m) throws AnalyzerException { /** * Constructs a new frame with the given size. - * + * * @param nLocals * the maximum number of local variables of the frame. * @param nStack @@ -425,7 +425,7 @@ protected Frame newFrame(final int nLocals, final int nStack) { /** * Constructs a new frame that is identical to the given frame. - * + * * @param src * a frame. * @return the created frame. @@ -439,7 +439,7 @@ protected Frame newFrame(final Frame src) { * method does nothing. It can be overriden in order to construct the * control flow graph of a method (this method is called by the * {@link #analyze analyze} method during its visit of the method's code). - * + * * @param insn * an instruction index. * @param successor @@ -454,7 +454,7 @@ protected void newControlFlowEdge(final int insn, final int successor) { * overridden in order to construct the control flow graph of a method (this * method is called by the {@link #analyze analyze} method during its visit * of the method's code). - * + * * @param insn * an instruction index. * @param successor @@ -476,7 +476,7 @@ protected boolean newControlFlowExceptionEdge(final int insn, * construct the control flow graph of a method (this method is called by * the {@link #analyze analyze} method during its visit of the method's * code). - * + * * @param insn * an instruction index. * @param tcb diff --git a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java index 99ae030..52b2a11 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java +++ b/src/main/java/scala/tools/asm/tree/analysis/AnalyzerException.java @@ -33,7 +33,7 @@ /** * Thrown if a problem occurs during the analysis of a method. - * + * * @author Bing Ran * @author Eric Bruneton */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java index 003461b..7d0b7b0 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicInterpreter.java @@ -45,7 +45,7 @@ /** * An {@link Interpreter} for {@link BasicValue} values. - * + * * @author Eric Bruneton * @author Bing Ran */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java index 53ac1e3..439941f 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicValue.java @@ -35,7 +35,7 @@ * A {@link Value} that is represented by its type in a seven types type system. * This type system distinguishes the UNINITIALZED, INT, FLOAT, LONG, DOUBLE, * REFERENCE and RETURNADDRESS types. - * + * * @author Eric Bruneton */ public class BasicValue implements Value { diff --git a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java index 0b1b4c6..b852f20 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/BasicVerifier.java @@ -40,7 +40,7 @@ /** * An extended {@link BasicInterpreter} that checks that bytecode instructions * are correctly used. - * + * * @author Eric Bruneton * @author Bing Ran */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/Frame.java b/src/main/java/scala/tools/asm/tree/analysis/Frame.java index 69fcc1b..fcc63a1 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Frame.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Frame.java @@ -46,10 +46,10 @@ * variable slots, and an operand stack. Warning: long and double values are * represented by two slots in local variables, and by one slot in * the operand stack. - * + * * @param * type of the Value used for the analysis. - * + * * @author Eric Bruneton */ public class Frame { @@ -77,7 +77,7 @@ public class Frame { /** * Constructs a new frame with the given size. - * + * * @param nLocals * the maximum number of local variables of the frame. * @param nStack @@ -91,7 +91,7 @@ public Frame(final int nLocals, final int nStack) { /** * Constructs a new frame that is identical to the given frame. - * + * * @param src * a frame. */ @@ -102,7 +102,7 @@ public Frame(final Frame src) { /** * Copies the state of the given frame into this frame. - * + * * @param src * a frame. * @return this frame. @@ -116,7 +116,7 @@ public Frame init(final Frame src) { /** * Sets the expected return type of the analyzed method. - * + * * @param v * the expected return type of the analyzed method, or * null if the method returns void. @@ -127,7 +127,7 @@ public void setReturn(final V v) { /** * Returns the maximum number of local variables of this frame. - * + * * @return the maximum number of local variables of this frame. */ public int getLocals() { @@ -136,16 +136,16 @@ public int getLocals() { /** * Returns the maximum stack size of this frame. - * + * * @return the maximum stack size of this frame. */ public int getMaxStackSize() { return values.length - locals; } - + /** * Returns the value of the given local variable. - * + * * @param i * a local variable index. * @return the value of the given local variable. @@ -162,7 +162,7 @@ public V getLocal(final int i) throws IndexOutOfBoundsException { /** * Sets the value of the given local variable. - * + * * @param i * a local variable index. * @param value @@ -182,7 +182,7 @@ public void setLocal(final int i, final V value) /** * Returns the number of values in the operand stack of this frame. Long and * double values are treated as single values. - * + * * @return the number of values in the operand stack of this frame. */ public int getStackSize() { @@ -191,7 +191,7 @@ public int getStackSize() { /** * Returns the value of the given operand stack slot. - * + * * @param i * the index of an operand stack slot. * @return the value of the given operand stack slot. @@ -211,7 +211,7 @@ public void clearStack() { /** * Pops a value from the operand stack of this frame. - * + * * @return the value that has been popped from the stack. * @throws IndexOutOfBoundsException * if the operand stack is empty. @@ -226,7 +226,7 @@ public V pop() throws IndexOutOfBoundsException { /** * Pushes a value into the operand stack of this frame. - * + * * @param value * the value that must be pushed into the stack. * @throws IndexOutOfBoundsException @@ -671,7 +671,7 @@ public void execute(final AbstractInsnNode insn, /** * Merges this frame with the given frame. - * + * * @param frame * a frame. * @param interpreter @@ -699,7 +699,7 @@ public boolean merge(final Frame frame, /** * Merges this frame with the given frame (case of a RET instruction). - * + * * @param frame * a frame * @param access @@ -721,7 +721,7 @@ public boolean merge(final Frame frame, final boolean[] access) { /** * Returns a string representation of this frame. - * + * * @return a string representation of this frame. */ @Override diff --git a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java index 782c3eb..56f4bed 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java @@ -41,10 +41,10 @@ * This separation allows a generic bytecode {@link Analyzer} to work with * various semantic interpreters, without needing to duplicate the code to * simulate the transfer of values. - * + * * @param * type of the Value used for the analysis. - * + * * @author Eric Bruneton */ public abstract class Interpreter { @@ -57,11 +57,11 @@ protected Interpreter(final int api) { /** * Creates a new value that represents the given type. - * + * * Called for method parameters (including this), exception * handler variable and with null type for variables reserved * by long and double types. - * + * * @param type * a primitive or reference type, or null to represent * an uninitialized value. @@ -73,11 +73,11 @@ protected Interpreter(final int api) { /** * Interprets a bytecode instruction without arguments. This method is * called for the following opcodes: - * + * * ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, * ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, * DCONST_1, BIPUSH, SIPUSH, LDC, JSR, GETSTATIC, NEW - * + * * @param insn * the bytecode instruction to be interpreted. * @return the result of the interpretation of the given instruction. @@ -90,10 +90,10 @@ public abstract V newOperation(AbstractInsnNode insn) /** * Interprets a bytecode instruction that moves a value on the stack or to * or from local variables. This method is called for the following opcodes: - * + * * ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, * ASTORE, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP - * + * * @param insn * the bytecode instruction to be interpreted. * @param value @@ -109,13 +109,13 @@ public abstract V copyOperation(AbstractInsnNode insn, V value) /** * Interprets a bytecode instruction with a single argument. This method is * called for the following opcodes: - * + * * INEG, LNEG, FNEG, DNEG, IINC, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, * F2D, D2I, D2L, D2F, I2B, I2C, I2S, IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, * TABLESWITCH, LOOKUPSWITCH, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN, * PUTSTATIC, GETFIELD, NEWARRAY, ANEWARRAY, ARRAYLENGTH, ATHROW, CHECKCAST, * INSTANCEOF, MONITORENTER, MONITOREXIT, IFNULL, IFNONNULL - * + * * @param insn * the bytecode instruction to be interpreted. * @param value @@ -130,14 +130,14 @@ public abstract V unaryOperation(AbstractInsnNode insn, V value) /** * Interprets a bytecode instruction with two arguments. This method is * called for the following opcodes: - * + * * IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IADD, * LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, * LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, ISHL, LSHL, ISHR, LSHR, IUSHR, * LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, LCMP, FCMPL, FCMPG, DCMPL, * DCMPG, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, * IF_ACMPEQ, IF_ACMPNE, PUTFIELD - * + * * @param insn * the bytecode instruction to be interpreted. * @param value1 @@ -154,9 +154,9 @@ public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2) /** * Interprets a bytecode instruction with three arguments. This method is * called for the following opcodes: - * + * * IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE - * + * * @param insn * the bytecode instruction to be interpreted. * @param value1 @@ -175,10 +175,10 @@ public abstract V ternaryOperation(AbstractInsnNode insn, V value1, /** * Interprets a bytecode instruction with a variable number of arguments. * This method is called for the following opcodes: - * + * * INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC, INVOKEINTERFACE, * MULTIANEWARRAY and INVOKEDYNAMIC - * + * * @param insn * the bytecode instruction to be interpreted. * @param values @@ -193,9 +193,9 @@ public abstract V naryOperation(AbstractInsnNode insn, /** * Interprets a bytecode return instruction. This method is called for the * following opcodes: - * + * * IRETURN, LRETURN, FRETURN, DRETURN, ARETURN - * + * * @param insn * the bytecode instruction to be interpreted. * @param value @@ -214,7 +214,7 @@ public abstract void returnOperation(AbstractInsnNode insn, V value, * the merged value must be a common super type of the two types. If the two * values are integer intervals, the merged value must be an interval that * contains the previous ones. Likewise for other types of values). - * + * * @param v * a value. * @param w diff --git a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java index 0471a4c..a345981 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SimpleVerifier.java @@ -37,7 +37,7 @@ * An extended {@link BasicVerifier} that performs more precise verifications. * This verifier computes exact class types, instead of using a single "object * reference" type (as done in the {@link BasicVerifier}). - * + * * @author Eric Bruneton * @author Bing Ran */ @@ -78,7 +78,7 @@ public SimpleVerifier() { /** * Constructs a new {@link SimpleVerifier} to verify a specific class. This * class will not be loaded into the JVM since it may be incorrect. - * + * * @param currentClass * the class that is verified. * @param currentSuperClass @@ -94,7 +94,7 @@ public SimpleVerifier(final Type currentClass, /** * Constructs a new {@link SimpleVerifier} to verify a specific class. This * class will not be loaded into the JVM since it may be incorrect. - * + * * @param currentClass * the class that is verified. * @param currentSuperClass @@ -125,7 +125,7 @@ protected SimpleVerifier(final int api, final Type currentClass, * Set the ClassLoader which will be used to load referenced * classes. This is useful if you are verifying multiple interdependent * classes. - * + * * @param loader * a ClassLoader to use */ diff --git a/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java b/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java index 56472e1..205878d 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SmallSet.java @@ -37,7 +37,7 @@ /** * A set of at most two elements. - * + * * @author Eric Bruneton */ class SmallSet extends AbstractSet implements Iterator { diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java index 8a24652..7d739d3 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceInterpreter.java @@ -43,7 +43,7 @@ /** * An {@link Interpreter} for {@link SourceValue} values. - * + * * @author Eric Bruneton */ public class SourceInterpreter extends Interpreter implements diff --git a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java index ed648a0e..40d6b68 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java +++ b/src/main/java/scala/tools/asm/tree/analysis/SourceValue.java @@ -36,7 +36,7 @@ /** * A {@link Value} that is represented by its type in a two types type system. * This type system distinguishes the ONEWORD and TWOWORDS types. - * + * * @author Eric Bruneton */ public class SourceValue implements Value { @@ -50,7 +50,7 @@ public class SourceValue implements Value { * The instructions that can produce this value. For example, for the Java * code below, the instructions that can produce the value of i at * line 5 are the txo ISTORE instructions at line 1 and 3: - * + * *
      * 1: i = 0;
      * 2: if (...) {
@@ -58,7 +58,7 @@ public class SourceValue implements Value {
      * 4: }
      * 5: return i;
      * 
- * + * * This field is a set of {@link AbstractInsnNode} objects. */ public final Set insns; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java index 5762cb8..5ce1bf0 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Subroutine.java @@ -37,7 +37,7 @@ /** * A method subroutine (corresponds to a JSR instruction). - * + * * @author Eric Bruneton */ class Subroutine { diff --git a/src/main/java/scala/tools/asm/tree/analysis/Value.java b/src/main/java/scala/tools/asm/tree/analysis/Value.java index 63a293b..1edf475 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Value.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Value.java @@ -31,14 +31,14 @@ /** * An immutable symbolic value for semantic interpretation of bytecode. - * + * * @author Eric Bruneton */ public interface Value { /** * Returns the size of this value in words. - * + * * @return either 1 or 2. */ int getSize(); diff --git a/src/main/java/scala/tools/asm/util/ASMifiable.java b/src/main/java/scala/tools/asm/util/ASMifiable.java index be4f569..95cc6e3 100644 --- a/src/main/java/scala/tools/asm/util/ASMifiable.java +++ b/src/main/java/scala/tools/asm/util/ASMifiable.java @@ -36,14 +36,14 @@ /** * An {@link scala.tools.asm.Attribute Attribute} that can print the ASM code * to create an equivalent attribute. - * + * * @author Eugene Kuleshov */ public interface ASMifiable { /** * Prints the ASM code to create an attribute equal to this attribute. - * + * * @param buf * a buffer used for printing Java code. * @param varName diff --git a/src/main/java/scala/tools/asm/util/ASMifier.java b/src/main/java/scala/tools/asm/util/ASMifier.java index be95b9e..4b245eb 100644 --- a/src/main/java/scala/tools/asm/util/ASMifier.java +++ b/src/main/java/scala/tools/asm/util/ASMifier.java @@ -44,7 +44,7 @@ /** * A {@link Printer} that prints the ASM code to generate the classes if visits. - * + * * @author Eric Bruneton */ public class ASMifier extends Printer { @@ -84,7 +84,7 @@ public class ASMifier extends Printer { * Constructs a new {@link ASMifier}. Subclasses must not use this * constructor. Instead, they must use the * {@link #ASMifier(int, String, int)} version. - * + * * @throws IllegalStateException * If a subclass calls this constructor. */ @@ -97,7 +97,7 @@ public ASMifier() { /** * Constructs a new {@link ASMifier}. - * + * * @param api * the ASM API version implemented by this class. Must be one of * {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -118,10 +118,10 @@ protected ASMifier(final int api, final String name, final int id) { * output. *

* Usage: ASMifier [-debug] <binary class name or class file name> - * + * * @param args * the command line arguments. - * + * * @throws Exception * if the class cannot be found, or if an IO exception occurs. */ @@ -949,7 +949,7 @@ protected ASMifier createASMifier(final String name, final int id) { /** * Appends a string representation of the given access modifiers to * {@link #buf buf}. - * + * * @param access * some access modifiers. */ @@ -1099,7 +1099,7 @@ void appendAccess(final int access) { /** * Appends a string representation of the given constant to the given * buffer. - * + * * @param cst * an {@link Integer}, {@link Float}, {@link Long}, * {@link Double} or {@link String} object. May be null. @@ -1111,7 +1111,7 @@ protected void appendConstant(final Object cst) { /** * Appends a string representation of the given constant to the given * buffer. - * + * * @param buf * a string buffer. * @param cst @@ -1262,7 +1262,7 @@ private void appendFrameTypes(final int n, final Object[] o) { * Appends a declaration of the given label to {@link #buf buf}. This * declaration is of the form "Label lXXX = new Label();". Does nothing if * the given label has already been declared. - * + * * @param l * a label. */ @@ -1282,7 +1282,7 @@ protected void declareLabel(final Label l) { * Appends the name of the given label to {@link #buf buf}. The given label * must already have a name. One way to ensure this is to always call * {@link #declareLabel declared} before calling this method. - * + * * @param l * a label. */ diff --git a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java index 7f07e7d..70441d1 100644 --- a/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckAnnotationAdapter.java @@ -35,7 +35,7 @@ /** * An {@link AnnotationVisitor} that checks that its methods are properly used. - * + * * @author Eric Bruneton */ public class CheckAnnotationAdapter extends AnnotationVisitor { diff --git a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java index fca5734..88afdb0 100644 --- a/src/main/java/scala/tools/asm/util/CheckClassAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckClassAdapter.java @@ -62,36 +62,36 @@ * of method calls. For example, the invalid sequence * visitField(ACC_PUBLIC, "i", "I", null) visitField(ACC_PUBLIC, * "i", "D", null) will not be detected by this class adapter. - * + * *

* CheckClassAdapter can be also used to verify bytecode * transformations in order to make sure transformed bytecode is sane. For * example: - * + * *

  *   InputStream is = ...; // get bytes for the source class
  *   ClassReader cr = new ClassReader(is);
  *   ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
  *   ClassVisitor cv = new MyClassAdapter(new CheckClassAdapter(cw));
  *   cr.accept(cv, 0);
- * 
+ *
  *   StringWriter sw = new StringWriter();
  *   PrintWriter pw = new PrintWriter(sw);
  *   CheckClassAdapter.verify(new ClassReader(cw.toByteArray()), false, pw);
  *   assertTrue(sw.toString(), sw.toString().length()==0);
  * 
- * + * * Above code runs transformed bytecode trough the * CheckClassAdapter. It won't be exactly the same verification as * JVM does, but it run data flow analysis for the code of each method and * checks that expectations are met for each method instruction. - * + * *

* If method bytecode has errors, assertion text will show the erroneous * instruction number and dump of the failed method with information about * locals and stack slot for each instruction. For example (format is - * insnNumber locals : stack): - * + * *

  * org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 71: Expected I, but found .
  *   at org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:289)
@@ -104,24 +104,24 @@
  *   ISTORE 2
  * 00001 LinkedBlockingQueue$Itr . I . . . . . .  :
  * ...
- * 
+ *
  * 00071 LinkedBlockingQueue$Itr . I . . . . . .  :
  *   ILOAD 1
  * 00072 ?
  *   INVOKESPECIAL java/lang/Integer.<init> (I)V
  * ...
  * 
- * + * * In the above output you can see that variable 1 loaded by * ILOAD 1 instruction at position 00071 is not * initialized. You can also see that at the beginning of the method (code * inserted by the transformation) variable 2 is initialized. - * + * *

* Note that when used like that, CheckClassAdapter.verify() can * trigger additional class loading, because it is using * SimpleVerifier. - * + * * @author Eric Bruneton */ public class CheckClassAdapter extends ClassVisitor { @@ -166,10 +166,10 @@ public class CheckClassAdapter extends ClassVisitor { * Checks a given class. *

* Usage: CheckClassAdapter <binary class name or class file name> - * + * * @param args * the command line arguments. - * + * * @throws Exception * if the class cannot be found, or if an IO exception occurs. */ @@ -192,7 +192,7 @@ public static void main(final String[] args) throws Exception { /** * Checks a given class. - * + * * @param cr * a ClassReader that contains bytecode for the * analysis. @@ -244,7 +244,7 @@ public static void verify(final ClassReader cr, final ClassLoader loader, /** * Checks a given class - * + * * @param cr * a ClassReader that contains bytecode for the * analysis. @@ -310,7 +310,7 @@ private static String getShortName(final String name) { * Constructs a new {@link CheckClassAdapter}. Subclasses must not use * this constructor. Instead, they must use the * {@link #CheckClassAdapter(int, ClassVisitor, boolean)} version. - * + * * @param cv * the class visitor to which this adapter must delegate calls. */ @@ -322,7 +322,7 @@ public CheckClassAdapter(final ClassVisitor cv) { * Constructs a new {@link CheckClassAdapter}. Subclasses must not use * this constructor. Instead, they must use the * {@link #CheckClassAdapter(int, ClassVisitor, boolean)} version. - * + * * @param cv * the class visitor to which this adapter must delegate calls. * @param checkDataFlow @@ -342,7 +342,7 @@ public CheckClassAdapter(final ClassVisitor cv, final boolean checkDataFlow) { /** * Constructs a new {@link CheckClassAdapter}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -588,7 +588,7 @@ private void checkState() { * Checks that the given access flags do not contain invalid flags. This * method also checks that mutually incompatible flags are not set * simultaneously. - * + * * @param access * the access flags to be checked * @param possibleAccess @@ -617,7 +617,7 @@ static void checkAccess(final int access, final int possibleAccess) { /** * Checks a class signature. - * + * * @param signature * a string containing the signature that must be checked. */ @@ -641,7 +641,7 @@ public static void checkClassSignature(final String signature) { /** * Checks a method signature. - * + * * @param signature * a string containing the signature that must be checked. */ @@ -680,7 +680,7 @@ public static void checkMethodSignature(final String signature) { /** * Checks a field signature. - * + * * @param signature * a string containing the signature that must be checked. */ @@ -694,7 +694,7 @@ public static void checkFieldSignature(final String signature) { /** * Checks the reference to a type in a type annotation. - * + * * @param typeRef * a reference to an annotated type. * @param typePath @@ -765,7 +765,7 @@ static void checkTypeRefAndPath(int typeRef, TypePath typePath) { /** * Checks the formal type parameters of a class or method signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -786,7 +786,7 @@ private static int checkFormalTypeParameters(final String signature, int pos) { /** * Checks a formal type parameter of a class or method signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -810,7 +810,7 @@ private static int checkFormalTypeParameter(final String signature, int pos) { /** * Checks a field type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -836,7 +836,7 @@ private static int checkFieldTypeSignature(final String signature, int pos) { /** * Checks a class type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -867,7 +867,7 @@ private static int checkClassTypeSignature(final String signature, int pos) { /** * Checks the type arguments in a class type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -888,7 +888,7 @@ private static int checkTypeArguments(final String signature, int pos) { /** * Checks a type argument in a class type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -910,7 +910,7 @@ private static int checkTypeArgument(final String signature, int pos) { /** * Checks a type variable signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -929,7 +929,7 @@ private static int checkTypeVariableSignature(final String signature, /** * Checks a type signature. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -957,7 +957,7 @@ private static int checkTypeSignature(final String signature, int pos) { /** * Checks an identifier. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -978,7 +978,7 @@ private static int checkIdentifier(final String signature, int pos) { /** * Checks a single character. - * + * * @param signature * a string containing the signature that must be checked. * @param pos @@ -995,7 +995,7 @@ private static int checkChar(final char c, final String signature, int pos) { /** * Returns the signature car at the given index. - * + * * @param signature * a signature. * @param pos diff --git a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java index 5a93f48..e682df4 100644 --- a/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckFieldAdapter.java @@ -47,7 +47,7 @@ public class CheckFieldAdapter extends FieldVisitor { * Constructs a new {@link CheckFieldAdapter}. Subclasses must not use * this constructor. Instead, they must use the * {@link #CheckFieldAdapter(int, FieldVisitor)} version. - * + * * @param fv * the field visitor to which this adapter must delegate calls. * @throws IllegalStateException @@ -62,7 +62,7 @@ public CheckFieldAdapter(final FieldVisitor fv) { /** * Constructs a new {@link CheckFieldAdapter}. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. diff --git a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java index b182b50..0577038 100644 --- a/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckMethodAdapter.java @@ -66,7 +66,7 @@ * checks are enabled. These checks are enabled by using the * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)} constructor. * They are not performed if any other constructor is used. - * + * * @author Eric Bruneton */ public class CheckMethodAdapter extends MethodVisitor { @@ -373,7 +373,7 @@ public class CheckMethodAdapter extends MethodVisitor { * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}). * Subclasses must not use this constructor. Instead, they must use * the {@link #CheckMethodAdapter(int, MethodVisitor, Map)} version. - * + * * @param mv * the method visitor to which this adapter must delegate calls. */ @@ -387,7 +387,7 @@ public CheckMethodAdapter(final MethodVisitor mv) { * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}). * Subclasses must not use this constructor. Instead, they must use * the {@link #CheckMethodAdapter(int, MethodVisitor, Map)} version. - * + * * @param mv * the method visitor to which this adapter must delegate calls. * @param labels @@ -407,7 +407,7 @@ public CheckMethodAdapter(final MethodVisitor mv, * Constructs a new {@link CheckMethodAdapter} object. This method adapter * will not perform any data flow check (see * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}). - * + * * @param api * the ASM API version implemented by this CheckMethodAdapter. * Must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. @@ -429,7 +429,7 @@ protected CheckMethodAdapter(final int api, final MethodVisitor mv, * will perform basic data flow checks. For instance in a method whose * signature is void m (), the invalid instruction IRETURN, or the * invalid sequence IADD L2I will be detected. - * + * * @param access * the method's access flags. * @param name @@ -1065,7 +1065,7 @@ void checkEndMethod() { /** * Checks a stack frame value. - * + * * @param value * the value to be checked. */ @@ -1090,7 +1090,7 @@ void checkFrameValue(final Object value) { /** * Checks that the type of the given opcode is equal to the given type. - * + * * @param opcode * the opcode to be checked. * @param type @@ -1104,7 +1104,7 @@ static void checkOpcode(final int opcode, final int type) { /** * Checks that the given value is a signed byte. - * + * * @param value * the value to be checked. * @param msg @@ -1119,7 +1119,7 @@ static void checkSignedByte(final int value, final String msg) { /** * Checks that the given value is a signed short. - * + * * @param value * the value to be checked. * @param msg @@ -1134,7 +1134,7 @@ static void checkSignedShort(final int value, final String msg) { /** * Checks that the given value is an unsigned short. - * + * * @param value * the value to be checked. * @param msg @@ -1150,7 +1150,7 @@ static void checkUnsignedShort(final int value, final String msg) { /** * Checks that the given value is an {@link Integer}, a{@link Float}, a * {@link Long}, a {@link Double} or a {@link String}. - * + * * @param cst * the value to be checked. */ @@ -1192,7 +1192,7 @@ void checkLDCConstant(final Object cst) { /** * Checks that the given string is a valid unqualified name. - * + * * @param version * the class version. * @param name @@ -1216,7 +1216,7 @@ static void checkUnqualifiedName(int version, final String name, /** * Checks that the given string is a valid Java identifier. - * + * * @param name * the string to be checked. * @param msg @@ -1228,7 +1228,7 @@ static void checkIdentifier(final String name, final String msg) { /** * Checks that the given substring is a valid Java identifier. - * + * * @param name * the string to be checked. * @param start @@ -1261,7 +1261,7 @@ static void checkIdentifier(final String name, final int start, /** * Checks that the given string is a valid Java identifier. - * + * * @param version * the class version. * @param name @@ -1304,7 +1304,7 @@ static void checkMethodIdentifier(int version, final String name, /** * Checks that the given string is a valid internal class name. - * + * * @param name * the string to be checked. * @param msg @@ -1324,7 +1324,7 @@ static void checkInternalName(final String name, final String msg) { /** * Checks that the given substring is a valid internal class name. - * + * * @param name * the string to be checked. * @param start @@ -1361,7 +1361,7 @@ static void checkInternalName(final String name, final int start, /** * Checks that the given string is a valid type descriptor. - * + * * @param desc * the string to be checked. * @param canBeVoid @@ -1376,7 +1376,7 @@ static void checkDesc(final String desc, final boolean canBeVoid) { /** * Checks that a the given substring is a valid type descriptor. - * + * * @param desc * the string to be checked. * @param start @@ -1440,7 +1440,7 @@ static int checkDesc(final String desc, final int start, /** * Checks that the given string is a valid method descriptor. - * + * * @param desc * the string to be checked. */ @@ -1471,7 +1471,7 @@ static void checkMethodDesc(final String desc) { /** * Checks that the given label is not null. This method can also check that * the label has been visited. - * + * * @param label * the label to be checked. * @param checkVisited @@ -1493,7 +1493,7 @@ void checkLabel(final Label label, final boolean checkVisited, /** * Checks that the given label is not a label used only for debug purposes. - * + * * @param label * the label to be checked. */ @@ -1513,7 +1513,7 @@ private static void checkNonDebugLabel(final Label label) { /** * Returns the Field object corresponding to the Label.status field. - * + * * @return the Field object corresponding to the Label.status field. */ private static Field getLabelStatusField() { @@ -1528,7 +1528,7 @@ private static Field getLabelStatusField() { /** * Returns the field of the Label class whose name is given. - * + * * @param name * a field name. * @return the field of the Label class whose name is given, or null. diff --git a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java index 9cad666..54c9033 100644 --- a/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java +++ b/src/main/java/scala/tools/asm/util/CheckSignatureAdapter.java @@ -34,7 +34,7 @@ /** * A {@link SignatureVisitor} that checks that its methods are properly used. - * + * * @author Eric Bruneton */ public class CheckSignatureAdapter extends SignatureVisitor { @@ -103,7 +103,7 @@ public class CheckSignatureAdapter extends SignatureVisitor { * Creates a new {@link CheckSignatureAdapter} object. Subclasses must * not use this constructor. Instead, they must use the * {@link #CheckSignatureAdapter(int, int, SignatureVisitor)} version. - * + * * @param type * the type of signature to be checked. See * {@link #CLASS_SIGNATURE}, {@link #METHOD_SIGNATURE} and @@ -118,7 +118,7 @@ public CheckSignatureAdapter(final int type, final SignatureVisitor sv) { /** * Creates a new {@link CheckSignatureAdapter} object. - * + * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. diff --git a/src/main/java/scala/tools/asm/util/Printer.java b/src/main/java/scala/tools/asm/util/Printer.java index 22f8d6e..46fdc51 100644 --- a/src/main/java/scala/tools/asm/util/Printer.java +++ b/src/main/java/scala/tools/asm/util/Printer.java @@ -41,7 +41,7 @@ /** * An abstract converter from visit events to text. - * + * * @author Eric Bruneton */ public abstract class Printer { @@ -1123,7 +1123,7 @@ public Printer visitLocalVariableAnnotation(final int typeRef, /** * Returns the text constructed by this visitor. - * + * * @return the text constructed by this visitor. */ public List getText() { @@ -1132,7 +1132,7 @@ public List getText() { /** * Prints the text constructed by this visitor. - * + * * @param pw * the print writer to be used. */ @@ -1142,7 +1142,7 @@ public void print(final PrintWriter pw) { /** * Appends a quoted string to a given buffer. - * + * * @param buf * the buffer where the string must be added. * @param s @@ -1179,7 +1179,7 @@ public static void appendString(final StringBuffer buf, final String s) { /** * Prints the given string tree. - * + * * @param pw * the writer to be used to print the tree. * @param l diff --git a/src/main/java/scala/tools/asm/util/Textifiable.java b/src/main/java/scala/tools/asm/util/Textifiable.java index 9b168ca..85e051e 100644 --- a/src/main/java/scala/tools/asm/util/Textifiable.java +++ b/src/main/java/scala/tools/asm/util/Textifiable.java @@ -36,17 +36,17 @@ /** * An {@link scala.tools.asm.Attribute Attribute} that can print a readable * representation of itself. - * + * * Implementations should construct readable output from an attribute data * structure. Such representation could be used in unit test assertions. - * + * * @author Eugene Kuleshov */ public interface Textifiable { /** * Build a human readable representation of this attribute. - * + * * @param buf * a buffer used for printing Java code. * @param labelNames diff --git a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java index 02d2963..7a9dbfe 100644 --- a/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceAnnotationVisitor.java @@ -35,7 +35,7 @@ /** * An {@link AnnotationVisitor} that prints the annotations it visits with a * {@link Printer}. - * + * * @author Eric Bruneton */ public final class TraceAnnotationVisitor extends AnnotationVisitor { diff --git a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java index a6a6722..842d286 100644 --- a/src/main/java/scala/tools/asm/util/TraceClassVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceClassVisitor.java @@ -48,36 +48,36 @@ * The trace printed when visiting the Hello class is the following: *

*

- * + * *
  * // class version 49.0 (49) // access flags 0x21 public class Hello {
- * 
+ *
  * // compiled from: Hello.java
- * 
+ *
  * // access flags 0x1 public <init> ()V ALOAD 0 INVOKESPECIAL
  * java/lang/Object <init> ()V RETURN MAXSTACK = 1 MAXLOCALS = 1
- * 
+ *
  * // access flags 0x9 public static main ([Ljava/lang/String;)V GETSTATIC
  * java/lang/System out Ljava/io/PrintStream; LDC "hello"
  * INVOKEVIRTUAL java/io/PrintStream println (Ljava/lang/String;)V RETURN
  * MAXSTACK = 2 MAXLOCALS = 1 }
  * 
- * + * *
where Hello is defined by: *

*

- * + * *
  * public class Hello {
- * 
+ *
  *     public static void main(String[] args) {
  *         System.out.println("hello");
  *     }
  * }
  * 
- * + * *
- * + * * @author Eric Bruneton * @author Eugene Kuleshov */ @@ -95,7 +95,7 @@ public final class TraceClassVisitor extends ClassVisitor { /** * Constructs a new {@link TraceClassVisitor}. - * + * * @param pw * the print writer to be used to print the class. */ @@ -105,7 +105,7 @@ public TraceClassVisitor(final PrintWriter pw) { /** * Constructs a new {@link TraceClassVisitor}. - * + * * @param cv * the {@link ClassVisitor} to which this visitor delegates * calls. May be null. @@ -118,7 +118,7 @@ public TraceClassVisitor(final ClassVisitor cv, final PrintWriter pw) { /** * Constructs a new {@link TraceClassVisitor}. - * + * * @param cv * the {@link ClassVisitor} to which this visitor delegates * calls. May be null. diff --git a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java index dc954fe..1d0743a 100644 --- a/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceFieldVisitor.java @@ -38,7 +38,7 @@ /** * A {@link FieldVisitor} that prints the fields it visits with a * {@link Printer}. - * + * * @author Eric Bruneton */ public final class TraceFieldVisitor extends FieldVisitor { diff --git a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java index 81cfcee..db5f051 100644 --- a/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceMethodVisitor.java @@ -40,7 +40,7 @@ /** * A {@link MethodVisitor} that prints the methods it visits with a * {@link Printer}. - * + * * @author Eric Bruneton */ public final class TraceMethodVisitor extends MethodVisitor { diff --git a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java index e68e3f4..6e3af30 100644 --- a/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java +++ b/src/main/java/scala/tools/asm/util/TraceSignatureVisitor.java @@ -35,7 +35,7 @@ /** * A {@link SignatureVisitor} that prints a disassembled view of the signature * it visits. - * + * * @author Eugene Kuleshov * @author Eric Bruneton */ From decf106bf88cfcd7903c45256e3ecd31d071f31f Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 15:51:14 +0200 Subject: [PATCH 06/17] [asm-cherry-pick] asm.CustomAttribute class Allows creating an asm.Attribute and directly providing the content as a byte array. Cherry-pick of https://github.com/lrytz/scala/commit/9a7e518a4ed686fda4fe39995d5d3aa29d396622 --- src/main/java/scala/tools/asm/CustomAttr.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/scala/tools/asm/CustomAttr.java diff --git a/src/main/java/scala/tools/asm/CustomAttr.java b/src/main/java/scala/tools/asm/CustomAttr.java new file mode 100644 index 0000000..5ecfd28 --- /dev/null +++ b/src/main/java/scala/tools/asm/CustomAttr.java @@ -0,0 +1,20 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2012 LAMP/EPFL + */ + +package scala.tools.asm; + +import scala.tools.asm.Attribute; + +/** + * A subclass of ASM's Attribute for the sole purpose of accessing a protected field there. + * + */ +public class CustomAttr extends Attribute { + + public CustomAttr(final String type, final byte[] value) { + super(type); + super.value = value; + } + +} From ceffb2c9cde7cdedf496fd0abe1bd91b71385a15 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 15:52:52 +0200 Subject: [PATCH 07/17] [asm-cherry-pick] Ensure instructions belong only to one list Fail early when adding an instruction that already belongs to a different instruction list. Cherry-pick of https://github.com/lrytz/scala/commit/eccd0dc5121c23ee7c7dd82cf9242dc02ff077e9 --- src/main/java/scala/tools/asm/tree/InsnList.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/scala/tools/asm/tree/InsnList.java b/src/main/java/scala/tools/asm/tree/InsnList.java index 698dd7a..9500feb 100644 --- a/src/main/java/scala/tools/asm/tree/InsnList.java +++ b/src/main/java/scala/tools/asm/tree/InsnList.java @@ -247,6 +247,14 @@ public void set(final AbstractInsnNode location, final AbstractInsnNode insn) { * {@link InsnList}. */ public void add(final AbstractInsnNode insn) { + if(insn.prev != null || insn.next != null) { + // Adding an instruction that still refers to others (in the same or another InsnList) leads to hard to debug bugs. + // Initially everything may look ok (e.g. iteration follows `next` thus a stale `prev` isn't noticed). + // However, a stale link brings the doubly-linked into disarray e.g. upon removing an element, + // which results in the `next` of a stale `prev` being updated, among other failure scenarios. + // Better fail early. + throw new RuntimeException("Instruction " + insn + " already belongs to some InsnList."); + } ++size; if (last == null) { first = insn; From 7bb61b5af6d70d55e0a9b846e83356c5fa8655a9 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 15:53:54 +0200 Subject: [PATCH 08/17] [asm-cherry-pick] Associate LabelNodes with their corresponding label Cherry-pick of https://github.com/lrytz/scala/commit/24585769b4b0f709fce07014ebb86e0b001d964b --- src/main/java/scala/tools/asm/tree/MethodNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/scala/tools/asm/tree/MethodNode.java b/src/main/java/scala/tools/asm/tree/MethodNode.java index 496d210..1630866 100644 --- a/src/main/java/scala/tools/asm/tree/MethodNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodNode.java @@ -623,7 +623,7 @@ public void visitEnd() { */ protected LabelNode getLabelNode(final Label l) { if (!(l.info instanceof LabelNode)) { - l.info = new LabelNode(); + l.info = new LabelNode(l); } return (LabelNode) l.info; } From d245723fc1f3060c3bdea3204fb64269863ded11 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 15:55:30 +0200 Subject: [PATCH 09/17] [asm-cherry-pick] Log names on method size overflow Cherry-pick of https://github.com/lrytz/scala/commit/34e32209164a3c227e4f15128e511067037c1574 --- src/main/java/scala/tools/asm/ClassWriter.java | 9 +++++++++ src/main/java/scala/tools/asm/MethodWriter.java | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/scala/tools/asm/ClassWriter.java b/src/main/java/scala/tools/asm/ClassWriter.java index afa335f..a0c8c8f 100644 --- a/src/main/java/scala/tools/asm/ClassWriter.java +++ b/src/main/java/scala/tools/asm/ClassWriter.java @@ -1781,6 +1781,15 @@ private void put(final Item i) { items[index] = i; } + /** + * Find item that whose index is `index`. + */ + public Item findItemByIndex(int index) { + int i = 0; + while (i < items.length && (items[i] == null || items[i].index != index)) i++; + return items[i]; + } + /** * Puts one byte and two shorts into the constant pool. * diff --git a/src/main/java/scala/tools/asm/MethodWriter.java b/src/main/java/scala/tools/asm/MethodWriter.java index af7fc53..9907a02 100644 --- a/src/main/java/scala/tools/asm/MethodWriter.java +++ b/src/main/java/scala/tools/asm/MethodWriter.java @@ -2033,7 +2033,10 @@ final int getSize() { int size = 8; if (code.length > 0) { if (code.length > 65535) { - throw new RuntimeException("Method code too large!"); + String nameString = ""; + Item nameItem = cw.findItemByIndex(name); + if (nameItem != null) nameString = nameItem.strVal1 +"'s "; + throw new RuntimeException("Method "+ nameString +"code too large!"); } cw.newUTF8("Code"); size += 18 + code.length + 8 * handlerCount; From af39f30be2ec922c472617e1dddcb82a062bb694 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 15:56:40 +0200 Subject: [PATCH 10/17] [asm-cherry-pick] Use MethodWriter to compute maxLocals / maxStack Make class MethodWriter public and add accessors for maxLocals and maxStack. This is the simplest way to compute the maxs using the ASM framework. It is used in the optimizer, see https://github.com/scala/scala/commit/90781e8 Cherry-pick of https://github.com/lrytz/scala/commit/91810c972bcc8b025c656d6173d4e915ef3aeac8 --- src/main/java/scala/tools/asm/MethodWriter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/scala/tools/asm/MethodWriter.java b/src/main/java/scala/tools/asm/MethodWriter.java index 9907a02..f05edb9 100644 --- a/src/main/java/scala/tools/asm/MethodWriter.java +++ b/src/main/java/scala/tools/asm/MethodWriter.java @@ -37,7 +37,7 @@ * @author Eric Bruneton * @author Eugene Kuleshov */ -class MethodWriter extends MethodVisitor { +public class MethodWriter extends MethodVisitor { /** * Pseudo access flag used to denote constructors. @@ -235,11 +235,19 @@ class MethodWriter extends MethodVisitor { */ private int maxStack; + public int getMaxStack() { + return maxStack; + } + /** * Maximum number of local variables for this method. */ private int maxLocals; + public int getMaxLocals() { + return maxLocals; + } + /** * Number of local variables in the current stack map frame. */ From d57fb893b56e6a3b0a8a7ec8875c19fb1bf2836c Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 15:58:09 +0200 Subject: [PATCH 11/17] [asm-cherry-pick] Fix typos Fix typos. This change was initially part of https://github.com/scala/scala/commit/549dc880c5525e3a2f3ea6af35c7ae8a349b2bdc Cherry-pick of https://github.com/lrytz/scala/commit/e1fbc7f2c24cd7bd234866bc3746dbf4923adce5 --- src/main/java/scala/tools/asm/Label.java | 2 +- .../tools/asm/tree/analysis/Analyzer.java | 4 ++-- .../tools/asm/tree/analysis/Interpreter.java | 14 +++++++------- .../java/scala/tools/asm/util/Printer.java | 18 +++++++++--------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/scala/tools/asm/Label.java b/src/main/java/scala/tools/asm/Label.java index 70ff002..7c8fd9e 100644 --- a/src/main/java/scala/tools/asm/Label.java +++ b/src/main/java/scala/tools/asm/Label.java @@ -550,7 +550,7 @@ void visitSubroutine(final Label JSR, final long id, final int nbSubroutines) { } // ------------------------------------------------------------------------ - // Overriden Object methods + // Overridden Object methods // ------------------------------------------------------------------------ /** diff --git a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java index 1c46a85..b52b8c2 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java @@ -376,7 +376,7 @@ private void findSubroutine(int insn, final Subroutine sub, * instruction of the method. The size of the returned array is * equal to the number of instructions (and labels) of the method. A * given frame is null if the corresponding instruction - * cannot be reached, or if an error occured during the analysis of + * cannot be reached, or if an error occurred during the analysis of * the method. */ public Frame[] getFrames() { @@ -436,7 +436,7 @@ protected Frame newFrame(final Frame src) { /** * Creates a control flow graph edge. The default implementation of this - * method does nothing. It can be overriden in order to construct the + * method does nothing. It can be overridden in order to construct the * control flow graph of a method (this method is called by the * {@link #analyze analyze} method during its visit of the method's code). * diff --git a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java index 56f4bed..00fe6c8 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java @@ -82,7 +82,7 @@ protected Interpreter(final int api) { * the bytecode instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occured during the interpretation. + * if an error occurred during the interpretation. */ public abstract V newOperation(AbstractInsnNode insn) throws AnalyzerException; @@ -101,7 +101,7 @@ public abstract V newOperation(AbstractInsnNode insn) * @return the result of the interpretation of the given instruction. The * returned value must be equal to the given value. * @throws AnalyzerException - * if an error occured during the interpretation. + * if an error occurred during the interpretation. */ public abstract V copyOperation(AbstractInsnNode insn, V value) throws AnalyzerException; @@ -122,7 +122,7 @@ public abstract V copyOperation(AbstractInsnNode insn, V value) * the argument of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occured during the interpretation. + * if an error occurred during the interpretation. */ public abstract V unaryOperation(AbstractInsnNode insn, V value) throws AnalyzerException; @@ -146,7 +146,7 @@ public abstract V unaryOperation(AbstractInsnNode insn, V value) * the second argument of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occured during the interpretation. + * if an error occurred during the interpretation. */ public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2) throws AnalyzerException; @@ -167,7 +167,7 @@ public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2) * the third argument of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occured during the interpretation. + * if an error occurred during the interpretation. */ public abstract V ternaryOperation(AbstractInsnNode insn, V value1, V value2, V value3) throws AnalyzerException; @@ -185,7 +185,7 @@ public abstract V ternaryOperation(AbstractInsnNode insn, V value1, * the arguments of the instruction to be interpreted. * @return the result of the interpretation of the given instruction. * @throws AnalyzerException - * if an error occured during the interpretation. + * if an error occurred during the interpretation. */ public abstract V naryOperation(AbstractInsnNode insn, List values) throws AnalyzerException; @@ -203,7 +203,7 @@ public abstract V naryOperation(AbstractInsnNode insn, * @param expected * the expected return type of the analyzed method. * @throws AnalyzerException - * if an error occured during the interpretation. + * if an error occurred during the interpretation. */ public abstract void returnOperation(AbstractInsnNode insn, V value, V expected) throws AnalyzerException; diff --git a/src/main/java/scala/tools/asm/util/Printer.java b/src/main/java/scala/tools/asm/util/Printer.java index 46fdc51..c7e292d 100644 --- a/src/main/java/scala/tools/asm/util/Printer.java +++ b/src/main/java/scala/tools/asm/util/Printer.java @@ -254,7 +254,7 @@ public abstract Printer visitClassAnnotation(final String desc, */ public Printer visitClassTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -454,7 +454,7 @@ public abstract Printer visitFieldAnnotation(final String desc, */ public Printer visitFieldTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -488,7 +488,7 @@ public Printer visitFieldTypeAnnotation(final int typeRef, * allowed (see {@link Opcodes}). */ public void visitParameter(String name, int access) { - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -532,7 +532,7 @@ public abstract Printer visitMethodAnnotation(final String desc, */ public Printer visitMethodTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -764,7 +764,7 @@ public void visitMethodInsn(final int opcode, final String owner, visitMethodInsn(opcode, owner, name, desc, itf); return; } - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -795,7 +795,7 @@ public void visitMethodInsn(final int opcode, final String owner, visitMethodInsn(opcode, owner, name, desc); return; } - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -977,7 +977,7 @@ public abstract void visitMultiANewArrayInsn(final String desc, */ public Printer visitInsnAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -1022,7 +1022,7 @@ public abstract void visitTryCatchBlock(final Label start, final Label end, */ public Printer visitTryCatchAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** @@ -1086,7 +1086,7 @@ public abstract void visitLocalVariable(final String name, public Printer visitLocalVariableAnnotation(final int typeRef, final TypePath typePath, final Label[] start, final Label[] end, final int[] index, final String desc, final boolean visible) { - throw new RuntimeException("Must be overriden"); + throw new RuntimeException("Must be overridden"); } /** From 28446002b12f383f74529707cda421b5f15f8953 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 16:05:41 +0200 Subject: [PATCH 12/17] [asm-cherry-pick] Clarify the doc of MethodInsnNode.owner Cherry-pick of 97075ead32256648ab9b0f4b66bf474b53936c11 --- src/main/java/scala/tools/asm/tree/MethodInsnNode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java index 5f615ab..651dec3 100644 --- a/src/main/java/scala/tools/asm/tree/MethodInsnNode.java +++ b/src/main/java/scala/tools/asm/tree/MethodInsnNode.java @@ -45,6 +45,7 @@ public class MethodInsnNode extends AbstractInsnNode { /** * The internal name of the method's owner class (see * {@link scala.tools.asm.Type#getInternalName() getInternalName}). + * For methods of arrays, e.g., clone(), the array type descriptor. */ public String owner; From 3dcfa7bae4e1571f7015ccbe6dfc2919f20d7554 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 20 May 2015 20:03:42 +0200 Subject: [PATCH 13/17] [asm-cherry-pick] Allow setting stack values in analysis frames Adds a method `setStack` to analysis.Frame which allows setting the dataflow value of a stack slot. Used in nullness analysis. After, for example, an instance call, aliases of the receiver can be set to NotNull, both in locals and on the stack. --- .../java/scala/tools/asm/tree/analysis/Frame.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/scala/tools/asm/tree/analysis/Frame.java b/src/main/java/scala/tools/asm/tree/analysis/Frame.java index fcc63a1..2a9f76f 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Frame.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Frame.java @@ -202,6 +202,20 @@ public V getStack(final int i) throws IndexOutOfBoundsException { return values[i + locals]; } + /** + * Sets the value of the given stack slot. + * + * @param i + * the index of an operand stack slot. + * @param value + * the new value of the stack slot. + * @throws IndexOutOfBoundsException + * if the stack slot does not exist. + */ + public void setStack(final int i, final V value) throws IndexOutOfBoundsException { + values[i + locals] = value; + } + /** * Clears the operand stack of this frame. */ From 4bddf8b40de1cb47f9afeeef053559510df65741 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 21 May 2015 13:07:05 +0200 Subject: [PATCH 14/17] [asm-cherry-pick] Multiple methods for initializing analysis values Introduces a number of methods that are called when initializing or updating abstract values in an analyzer frame. Before this commit, Analyzer.analyze and Frame.execute would always call Interpreter.newValue for initializing or updating frame values. Having multiple methods allows users to return more precise values for the individual cases. For example, in a nullness analysis, the initial value for the `this` parameter of an instance method can be set to not-null. --- .../tools/asm/tree/analysis/Analyzer.java | 19 ++++--- .../scala/tools/asm/tree/analysis/Frame.java | 4 +- .../tools/asm/tree/analysis/Interpreter.java | 50 +++++++++++++++++++ 3 files changed, 64 insertions(+), 9 deletions(-) diff --git a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java index b52b8c2..7577c67 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Analyzer.java @@ -158,21 +158,26 @@ public Frame[] analyze(final String owner, final MethodNode m) // initializes the data structures for the control flow analysis Frame current = newFrame(m.maxLocals, m.maxStack); Frame handler = newFrame(m.maxLocals, m.maxStack); - current.setReturn(interpreter.newValue(Type.getReturnType(m.desc))); + current.setReturn(interpreter.newReturnTypeValue(Type.getReturnType(m.desc))); Type[] args = Type.getArgumentTypes(m.desc); int local = 0; - if ((m.access & ACC_STATIC) == 0) { + boolean isInstanceMethod = (m.access & ACC_STATIC) == 0; + if (isInstanceMethod) { Type ctype = Type.getObjectType(owner); - current.setLocal(local++, interpreter.newValue(ctype)); + current.setLocal(local, interpreter.newParameterValue(isInstanceMethod, local, ctype)); + local++; } for (int i = 0; i < args.length; ++i) { - current.setLocal(local++, interpreter.newValue(args[i])); + current.setLocal(local, interpreter.newParameterValue(isInstanceMethod, local, args[i])); + local++; if (args[i].getSize() == 2) { - current.setLocal(local++, interpreter.newValue(null)); + current.setLocal(local, interpreter.newEmptyValueAfterSize2Local(local)); + local++; } } while (local < m.maxLocals) { - current.setLocal(local++, interpreter.newValue(null)); + current.setLocal(local, interpreter.newEmptyNonParameterLocalValue(local)); + local++; } merge(0, current, null); @@ -285,7 +290,7 @@ public Frame[] analyze(final String owner, final MethodNode m) if (newControlFlowExceptionEdge(insn, tcb)) { handler.init(f); handler.clearStack(); - handler.push(interpreter.newValue(type)); + handler.push(interpreter.newExceptionValue(tcb, handler, type)); merge(jump, handler, subroutine); } } diff --git a/src/main/java/scala/tools/asm/tree/analysis/Frame.java b/src/main/java/scala/tools/asm/tree/analysis/Frame.java index 2a9f76f..bfffe3b 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Frame.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Frame.java @@ -312,12 +312,12 @@ public void execute(final AbstractInsnNode insn, var = ((VarInsnNode) insn).var; setLocal(var, value1); if (value1.getSize() == 2) { - setLocal(var + 1, interpreter.newValue(null)); + setLocal(var + 1, interpreter.newEmptyValueAfterSize2Local(var + 1)); } if (var > 0) { Value local = getLocal(var - 1); if (local != null && local.getSize() == 2) { - setLocal(var - 1, interpreter.newValue(null)); + setLocal(var - 1, interpreter.newEmptyValueForPreviousSize2Local(var - 1)); } } break; diff --git a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java index 00fe6c8..43104b4 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Interpreter.java @@ -33,6 +33,7 @@ import scala.tools.asm.Type; import scala.tools.asm.tree.AbstractInsnNode; +import scala.tools.asm.tree.TryCatchBlockNode; /** * A semantic bytecode interpreter. More precisely, this interpreter only @@ -70,6 +71,55 @@ protected Interpreter(final int api) { */ public abstract V newValue(Type type); + /** + * Called by the analyzer for initializing the return type value of a frame. + */ + public V newReturnTypeValue(Type type) { + return newValue(type); + } + + /** + * Called by the analyzer when initializing the value of a parameter in a frame. + */ + public V newParameterValue(boolean isInstanceMethod, int local, Type type) { + return newValue(type); + } + + /** + * Called by the analyzer when initializing a non-parameter local in a frame. + * This method has to return a size-1 value representing an empty slot. + */ + public V newEmptyNonParameterLocalValue(int local) { + return newValue(null); + } + + /** + * Called by the analyzer and the interpreter. When initializing or setting the value of a + * size-2 local, the value of the subsequent slot is reset using this method. + * This method has to return a size-1 value representing an empty slot. + */ + public V newEmptyValueAfterSize2Local(int local) { + return newValue(null); + } + + /** + * Called by the interpreter. When setting the value of a local variable, the interpreter checks + * whether the current value stored at the preceding index is of size-2. In this case, the + * preceding size-2 value is no longer valid and reset using this method. + * This method has to return a size-1 value representing an empty slot. + */ + public V newEmptyValueForPreviousSize2Local(int local) { + return newValue(null); + } + + /** + * Called by the analyzer when initializing the exception value on the call stack at the entry + * of an exception handler. + */ + public V newExceptionValue(TryCatchBlockNode tryCatchBlockNode, Frame handlerFrame, Type exceptionType) { + return newValue(exceptionType); + } + /** * Interprets a bytecode instruction without arguments. This method is * called for the following opcodes: From 4a7bb6a37d266d17636624d75e0c587486254cc6 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 17 Jun 2015 19:46:27 +0200 Subject: [PATCH 15/17] [asm-cherry-pick] Call interpreter.copyInstruction consistently for all copied values Before this change, `Frame.execute` did not invoke the interpreter's `copyInstruction` method for all values that are pushed on the frame's when executing some copying instructions. For example, in the case of SWAP, copyInstruction is invoked: value2 = pop(); value1 = pop(); push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); For DUP on the other hand, the original value is pushed onto the stack without notifying the interpreter: value1 = pop(); push(value1); push(interpreter.copyOperation(insn, value1)); This leads to a problem for the `SourceInterpreter`, which collects for every value a set of potential producer instructions. Given the bytecode sequence NEW java/lang/Object DUP INVOKESPECIAL java/lang/Object. ()V In the frame of the INVOKESPECIAL instruction, the value on the stack lists as its producer the `NEW` operation instead of the `DUP`, which not expected. --- .../scala/tools/asm/tree/analysis/Frame.java | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/scala/tools/asm/tree/analysis/Frame.java b/src/main/java/scala/tools/asm/tree/analysis/Frame.java index bfffe3b..8257065 100644 --- a/src/main/java/scala/tools/asm/tree/analysis/Frame.java +++ b/src/main/java/scala/tools/asm/tree/analysis/Frame.java @@ -351,7 +351,7 @@ public void execute(final AbstractInsnNode insn, if (value1.getSize() != 1) { throw new AnalyzerException(insn, "Illegal use of DUP"); } - push(value1); + push(interpreter.copyOperation(insn, value1)); push(interpreter.copyOperation(insn, value1)); break; case Opcodes.DUP_X1: @@ -361,8 +361,8 @@ public void execute(final AbstractInsnNode insn, throw new AnalyzerException(insn, "Illegal use of DUP_X1"); } push(interpreter.copyOperation(insn, value1)); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; case Opcodes.DUP_X2: value1 = pop(); @@ -372,15 +372,15 @@ public void execute(final AbstractInsnNode insn, value3 = pop(); if (value3.getSize() == 1) { push(interpreter.copyOperation(insn, value1)); - push(value3); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value3)); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } else { push(interpreter.copyOperation(insn, value1)); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } @@ -390,14 +390,14 @@ public void execute(final AbstractInsnNode insn, if (value1.getSize() == 1) { value2 = pop(); if (value2.getSize() == 1) { - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); break; } } else { - push(value1); + push(interpreter.copyOperation(insn, value1)); push(interpreter.copyOperation(insn, value1)); break; } @@ -411,9 +411,9 @@ public void execute(final AbstractInsnNode insn, if (value3.getSize() == 1) { push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); - push(value3); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value3)); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } @@ -421,8 +421,8 @@ public void execute(final AbstractInsnNode insn, value2 = pop(); if (value2.getSize() == 1) { push(interpreter.copyOperation(insn, value1)); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } @@ -438,18 +438,18 @@ public void execute(final AbstractInsnNode insn, if (value4.getSize() == 1) { push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); - push(value4); - push(value3); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value4)); + push(interpreter.copyOperation(insn, value3)); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } else { push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); - push(value3); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value3)); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } @@ -459,15 +459,15 @@ public void execute(final AbstractInsnNode insn, value3 = pop(); if (value3.getSize() == 1) { push(interpreter.copyOperation(insn, value1)); - push(value3); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value3)); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } else { push(interpreter.copyOperation(insn, value1)); - push(value2); - push(value1); + push(interpreter.copyOperation(insn, value2)); + push(interpreter.copyOperation(insn, value1)); break; } } From 81194e27821cd4fbeaf346c7472c3175a49d416b Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 16 Jul 2015 15:32:42 +0200 Subject: [PATCH 16/17] [asm-cherry-pick] Fix findItemByIndex in case of hash collisions The method `findItemByIndex` only looked at the first item in each bucket of the `items` hash table. Also, in case the item was not found, the counter `i` would be at `items.length`, therefore the access `items[i]` crashed with an ArrayIndexOutOfBoundsException. Fixes the issue https://github.com/scala/scala-asm/issues/8. --- src/main/java/scala/tools/asm/ClassWriter.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/scala/tools/asm/ClassWriter.java b/src/main/java/scala/tools/asm/ClassWriter.java index a0c8c8f..a9e93c2 100644 --- a/src/main/java/scala/tools/asm/ClassWriter.java +++ b/src/main/java/scala/tools/asm/ClassWriter.java @@ -1782,12 +1782,20 @@ private void put(final Item i) { } /** - * Find item that whose index is `index`. + * Returns the item with a specific index. + * + * @param index + * the index of the searched item. + * @return the item with the given index. */ public Item findItemByIndex(int index) { - int i = 0; - while (i < items.length && (items[i] == null || items[i].index != index)) i++; - return items[i]; + for (Item item : items) { + while (item != null) { + if (item.index == index) return item; + item = item.next; + } + } + return null; } /** From 450a410de3e5ab506121366dbc3a7f08d0573622 Mon Sep 17 00:00:00 2001 From: Carsten Varming Date: Mon, 18 Jul 2016 12:52:41 -0400 Subject: [PATCH 17/17] Update README.md after upgrading to ASM 5.1 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0fa325..604409a 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ This makes it easy to see how our fork differs from the official release. ## Current Version -The current sources are based on the following version of ASM ([browse tags here](http://websvn.ow2.org/listing.php?repname=asm&path=%2Ftags%2F&peg=1748)): +The current sources are based on the following version of ASM ([browse tags here](http://websvn.ow2.org/listing.php?repname=asm&path=%2Ftags%2F)): ``` -Version 5.0.4, SVN r1779, tags/ASM_5_0_4 +Version 5.1, SVN r1798, tags/ASM_5_1 ``` Previous ASM Upgrade PR: https://github.com/scala/scala-asm/pull/5