* designates the instruction just after the GOTO_W.
*/
if (opcode == Opcodes.GOTO) {
@@ -958,18 +909,16 @@ class MethodWriter extends MethodVisitor {
if (nextInsn != null) {
nextInsn.status |= Label.TARGET;
}
- code.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1
- : opcode ^ 1);
+ code.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1 : opcode ^ 1);
code.putShort(8); // jump offset
code.putByte(200); // GOTO_W
}
label.put(this, code, code.length - 1, true);
} else {
/*
- * case of a backward jump with an offset >= -32768, or of a forward
- * jump with, of course, an unknown offset. In these cases we store
- * the offset in 2 bytes (which will be increased in
- * resizeInstructions, if needed).
+ * case of a backward jump with an offset >= -32768, or of a forward jump with, of
+ * course, an unknown offset. In these cases we store the offset in 2 bytes (which will
+ * be increased in resizeInstructions, if needed).
*/
code.putByte(opcode);
label.put(this, code, code.length - 1, false);
@@ -1092,16 +1041,15 @@ class MethodWriter extends MethodVisitor {
}
// adds the instruction to the bytecode of the method
if ((var > 255) || (increment > 127) || (increment < -128)) {
- code.putByte(196 /* WIDE */).put12(Opcodes.IINC, var)
- .putShort(increment);
+ code.putByte(196 /* WIDE */).put12(Opcodes.IINC, var).putShort(increment);
} else {
code.putByte(Opcodes.IINC).put11(var, increment);
}
}
@Override
- public void visitTableSwitchInsn(final int min, final int max,
- final Label dflt, final Label... labels) {
+ public void visitTableSwitchInsn(final int min, final int max, final Label dflt,
+ final Label... labels) {
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Opcodes.TABLESWITCH);
@@ -1116,8 +1064,7 @@ class MethodWriter extends MethodVisitor {
}
@Override
- public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
- final Label[] labels) {
+ public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Opcodes.LOOKUPSWITCH);
@@ -1176,8 +1123,8 @@ class MethodWriter extends MethodVisitor {
}
@Override
- public void visitTryCatchBlock(final Label start, final Label end,
- final Label handler, final String type) {
+ public void visitTryCatchBlock(final Label start, final Label end, final Label handler,
+ final String type) {
++handlerCount;
Handler h = new Handler();
h.start = start;
@@ -1194,27 +1141,22 @@ class MethodWriter extends MethodVisitor {
}
@Override
- public void visitLocalVariable(final String name, final String desc,
- final String signature, final Label start, final Label end,
- final int index) {
+ public void visitLocalVariable(final String name, final String desc, final String signature,
+ final Label start, final Label end, final int index) {
if (signature != null) {
if (localVarType == null) {
localVarType = new ByteVector();
}
++localVarTypeCount;
- localVarType.putShort(start.position)
- .putShort(end.position - start.position)
- .putShort(cw.newUTF8(name)).putShort(cw.newUTF8(signature))
- .putShort(index);
+ localVarType.putShort(start.position).putShort(end.position - start.position)
+ .putShort(cw.newUTF8(name)).putShort(cw.newUTF8(signature)).putShort(index);
}
if (localVar == null) {
localVar = new ByteVector();
}
++localVarCount;
- localVar.putShort(start.position)
- .putShort(end.position - start.position)
- .putShort(cw.newUTF8(name)).putShort(cw.newUTF8(desc))
- .putShort(index);
+ localVar.putShort(start.position).putShort(end.position - start.position)
+ .putShort(cw.newUTF8(name)).putShort(cw.newUTF8(desc)).putShort(index);
if (compute != NOTHING) {
// updates max locals
char c = desc.charAt(0);
@@ -1245,8 +1187,7 @@ class MethodWriter extends MethodVisitor {
Label h = handler.handler.getFirst();
Label e = handler.end.getFirst();
// computes the kind of the edges to 'h'
- String t = handler.desc == null ? "java/lang/Throwable"
- : handler.desc;
+ String t = handler.desc == null ? "java/lang/Throwable" : handler.desc;
int kind = Frame.OBJECT | cw.addType(t);
// h is an exception handler
h.status |= Label.TARGET;
@@ -1272,10 +1213,9 @@ class MethodWriter extends MethodVisitor {
visitFrame(f);
/*
- * fix point algorithm: mark the first basic block as 'changed'
- * (i.e. put it in the 'changed' list) and, while there are changed
- * basic blocks, choose one, mark it as unchanged, and update its
- * successors (which can be changed in the process).
+ * fix point algorithm: mark the first basic block as 'changed' (i.e. put it in the
+ * 'changed' list) and, while there are changed basic blocks, choose one, mark it as
+ * unchanged, and update its successors (which can be changed in the process).
*/
int max = 0;
Label changed = labels;
@@ -1333,8 +1273,7 @@ class MethodWriter extends MethodVisitor {
code.data[end] = (byte) Opcodes.ATHROW;
// emits a frame for this unreachable block
int frameIndex = startFrame(start, 0, 1);
- frame[frameIndex] = Frame.OBJECT
- | cw.addType("java/lang/Throwable");
+ frame[frameIndex] = Frame.OBJECT | cw.addType("java/lang/Throwable");
endFrame();
// removes the start-end range from the exception
// handlers
@@ -1385,8 +1324,8 @@ class MethodWriter extends MethodVisitor {
if (subroutines > 0) {
// completes the control flow graph with the RET successors
/*
- * first step: finds the subroutines. This step determines, for
- * each basic block, to which subroutine(s) it belongs.
+ * first step: finds the subroutines. This step determines, for each basic block, to
+ * which subroutine(s) it belongs.
*/
// finds the basic blocks that belong to the "main" subroutine
int id = 0;
@@ -1401,8 +1340,8 @@ class MethodWriter extends MethodVisitor {
if ((subroutine.status & Label.VISITED) == 0) {
// ...assigns it a new id and finds its basic blocks
id += 1;
- subroutine.visitSubroutine(null, (id / 32L) << 32
- | (1L << (id % 32)), subroutines);
+ subroutine.visitSubroutine(null, (id / 32L) << 32 | (1L << (id % 32)),
+ subroutines);
}
}
l = l.successor;
@@ -1425,14 +1364,12 @@ class MethodWriter extends MethodVisitor {
}
/*
- * control flow analysis algorithm: while the block stack is not
- * empty, pop a block from this stack, update the max stack size,
- * compute the true (non relative) begin stack size of the
- * successors of this block, and push these successors onto the
- * stack (unless they have already been pushed onto the stack).
- * Note: by hypothesis, the {@link Label#inputStackTop} of the
- * blocks in the block stack are the true (non relative) beginning
- * stack sizes of these blocks.
+ * control flow analysis algorithm: while the block stack is not empty, pop a block from
+ * this stack, update the max stack size, compute the true (non relative) begin stack
+ * size of the successors of this block, and push these successors onto the stack
+ * (unless they have already been pushed onto the stack). Note: by hypothesis, the
+ * {@link Label#inputStackTop} of the blocks in the block stack are the true (non
+ * relative) beginning stack sizes of these blocks.
*/
int max = 0;
Label stack = labels;
@@ -1458,8 +1395,7 @@ class MethodWriter extends MethodVisitor {
// if this successor has not already been pushed...
if ((l.status & Label.PUSHED) == 0) {
// computes its true beginning stack size...
- l.inputStackTop = b.info == Edge.EXCEPTION ? 1 : start
- + b.info;
+ l.inputStackTop = b.info == Edge.EXCEPTION ? 1 : start + b.info;
// ...and pushes it onto the stack
l.status |= Label.PUSHED;
l.next = stack;
@@ -1476,8 +1412,7 @@ class MethodWriter extends MethodVisitor {
}
@Override
- public void visitEnd() {
- }
+ public void visitEnd() {}
// ------------------------------------------------------------------------
// Utility methods: control flow analysis algorithm
@@ -1486,10 +1421,8 @@ class MethodWriter extends MethodVisitor {
/**
* Adds a successor to the {@link #currentBlock currentBlock} block.
*
- * @param info
- * information about the control flow edge to be added.
- * @param successor
- * the successor block to be added to the current block.
+ * @param info information about the control flow edge to be added.
+ * @param successor the successor block to be added to the current block.
*/
private void addSuccessor(final int info, final Label successor) {
// creates and initializes an Edge object...
@@ -1502,8 +1435,8 @@ class MethodWriter extends MethodVisitor {
}
/**
- * Ends the current basic block. This method must be used in the case where
- * the current basic block does not have any successor.
+ * Ends the current basic block. This method must be used in the case where the current basic
+ * block does not have any successor.
*/
private void noSuccessor() {
if (compute == FRAMES) {
@@ -1526,8 +1459,7 @@ class MethodWriter extends MethodVisitor {
/**
* Visits a frame that has been computed from scratch.
*
- * @param f
- * the frame that must be visited.
+ * @param f the frame that must be visited.
*/
private void visitFrame(final Frame f) {
int i, t;
@@ -1595,44 +1527,43 @@ class MethodWriter extends MethodVisitor {
loop: while (true) {
int j = i;
switch (descriptor.charAt(i++)) {
- case 'Z':
- case 'C':
- case 'B':
- case 'S':
- case 'I':
- frame[frameIndex++] = 1; // Opcodes.INTEGER;
- break;
- case 'F':
- frame[frameIndex++] = 2; // Opcodes.FLOAT;
- break;
- case 'J':
- frame[frameIndex++] = 4; // Opcodes.LONG;
- break;
- case 'D':
- frame[frameIndex++] = 3; // Opcodes.DOUBLE;
- break;
- case '[':
- while (descriptor.charAt(i) == '[') {
- ++i;
- }
- if (descriptor.charAt(i) == 'L') {
- ++i;
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ frame[frameIndex++] = 1; // Opcodes.INTEGER;
+ break;
+ case 'F':
+ frame[frameIndex++] = 2; // Opcodes.FLOAT;
+ break;
+ case 'J':
+ frame[frameIndex++] = 4; // Opcodes.LONG;
+ break;
+ case 'D':
+ frame[frameIndex++] = 3; // Opcodes.DOUBLE;
+ break;
+ case '[':
+ while (descriptor.charAt(i) == '[') {
+ ++i;
+ }
+ if (descriptor.charAt(i) == 'L') {
+ ++i;
+ while (descriptor.charAt(i) != ';') {
+ ++i;
+ }
+ }
+ frame[frameIndex++] = Frame.OBJECT | cw.addType(descriptor.substring(j, ++i));
+ break;
+ case 'L':
while (descriptor.charAt(i) != ';') {
++i;
}
- }
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType(descriptor.substring(j, ++i));
- break;
- case 'L':
- while (descriptor.charAt(i) != ';') {
- ++i;
- }
- frame[frameIndex++] = Frame.OBJECT
- | cw.addType(descriptor.substring(j + 1, i++));
- break;
- default:
- break loop;
+ frame[frameIndex++] =
+ Frame.OBJECT | cw.addType(descriptor.substring(j + 1, i++));
+ break;
+ default:
+ break loop;
}
}
frame[1] = frameIndex - 3;
@@ -1642,12 +1573,9 @@ class MethodWriter extends MethodVisitor {
/**
* Starts the visit of a stack map frame.
*
- * @param offset
- * the offset of the instruction to which the frame corresponds.
- * @param nLocal
- * the number of local variables in the frame.
- * @param nStack
- * the number of stack elements in the frame.
+ * @param offset the offset of the instruction to which the frame corresponds.
+ * @param nLocal the number of local variables in the frame.
+ * @param nStack the number of stack elements in the frame.
* @return the index of the next element to be written in this frame.
*/
private int startFrame(final int offset, final int nLocal, final int nStack) {
@@ -1662,8 +1590,8 @@ class MethodWriter extends MethodVisitor {
}
/**
- * Checks if the visit of the current frame {@link #frame} is finished, and
- * if yes, write it in the StackMapTable attribute.
+ * Checks if the visit of the current frame {@link #frame} is finished, and if yes, write it in
+ * the StackMapTable attribute.
*/
private void endFrame() {
if (previousFrame != null) { // do not write the first frame
@@ -1678,8 +1606,7 @@ class MethodWriter extends MethodVisitor {
}
/**
- * Compress and writes the current frame {@link #frame} in the StackMapTable
- * attribute.
+ * Compress and writes the current frame {@link #frame} in the StackMapTable attribute.
*/
private void writeFrame() {
int clocalsSize = frame[1];
@@ -1703,20 +1630,20 @@ class MethodWriter extends MethodVisitor {
if (cstackSize == 0) {
k = clocalsSize - localsSize;
switch (k) {
- case -3:
- case -2:
- case -1:
- type = CHOP_FRAME;
- localsSize = clocalsSize;
- break;
- case 0:
- type = delta < 64 ? SAME_FRAME : SAME_FRAME_EXTENDED;
- break;
- case 1:
- case 2:
- case 3:
- type = APPEND_FRAME;
- break;
+ case -3:
+ case -2:
+ case -1:
+ type = CHOP_FRAME;
+ localsSize = clocalsSize;
+ break;
+ case 0:
+ type = delta < 64 ? SAME_FRAME : SAME_FRAME_EXTENDED;
+ break;
+ case 1:
+ case 2:
+ case 3:
+ type = APPEND_FRAME;
+ break;
}
} else if (clocalsSize == localsSize && cstackSize == 1) {
type = delta < 63 ? SAME_LOCALS_1_STACK_ITEM_FRAME
@@ -1734,47 +1661,44 @@ class MethodWriter extends MethodVisitor {
}
}
switch (type) {
- case SAME_FRAME:
- stackMap.putByte(delta);
- break;
- case SAME_LOCALS_1_STACK_ITEM_FRAME:
- stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
- writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
- break;
- case SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
- stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED).putShort(
- delta);
- writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
- break;
- case SAME_FRAME_EXTENDED:
- stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
- break;
- case CHOP_FRAME:
- stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
- break;
- case APPEND_FRAME:
- stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
- writeFrameTypes(3 + localsSize, 3 + clocalsSize);
- break;
- // case FULL_FRAME:
- default:
- stackMap.putByte(FULL_FRAME).putShort(delta).putShort(clocalsSize);
- writeFrameTypes(3, 3 + clocalsSize);
- stackMap.putShort(cstackSize);
- writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
+ case SAME_FRAME:
+ stackMap.putByte(delta);
+ break;
+ case SAME_LOCALS_1_STACK_ITEM_FRAME:
+ stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
+ writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
+ break;
+ case SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
+ stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED).putShort(delta);
+ writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
+ break;
+ case SAME_FRAME_EXTENDED:
+ stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
+ break;
+ case CHOP_FRAME:
+ stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
+ break;
+ case APPEND_FRAME:
+ stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
+ writeFrameTypes(3 + localsSize, 3 + clocalsSize);
+ break;
+ // case FULL_FRAME:
+ default:
+ stackMap.putByte(FULL_FRAME).putShort(delta).putShort(clocalsSize);
+ writeFrameTypes(3, 3 + clocalsSize);
+ stackMap.putShort(cstackSize);
+ writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
}
}
/**
- * Writes some types of the current frame {@link #frame} into the
- * 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.
+ * Writes some types of the current frame {@link #frame} into the 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
- * index of last type in {@link #frame} to write (exclusive).
+ * @param start index of the first type in {@link #frame} to write.
+ * @param end index of last type in {@link #frame} to write (exclusive).
*/
private void writeFrameTypes(final int start, final int end) {
for (int i = start; i < end; ++i) {
@@ -1783,15 +1707,14 @@ class MethodWriter extends MethodVisitor {
if (d == 0) {
int v = t & Frame.BASE_VALUE;
switch (t & Frame.BASE_KIND) {
- case Frame.OBJECT:
- stackMap.putByte(7).putShort(
- cw.newClass(cw.typeTable[v].strVal1));
- break;
- case Frame.UNINITIALIZED:
- stackMap.putByte(8).putShort(cw.typeTable[v].intVal);
- break;
- default:
- stackMap.putByte(v);
+ case Frame.OBJECT:
+ stackMap.putByte(7).putShort(cw.newClass(cw.typeTable[v].strVal1));
+ break;
+ case Frame.UNINITIALIZED:
+ stackMap.putByte(8).putShort(cw.typeTable[v].intVal);
+ break;
+ default:
+ stackMap.putByte(v);
}
} else {
StringBuffer buf = new StringBuffer();
@@ -1805,29 +1728,29 @@ class MethodWriter extends MethodVisitor {
buf.append(';');
} else {
switch (t & 0xF) {
- case 1:
- buf.append('I');
- break;
- case 2:
- buf.append('F');
- break;
- case 3:
- buf.append('D');
- break;
- case 9:
- buf.append('Z');
- break;
- case 10:
- buf.append('B');
- break;
- case 11:
- buf.append('C');
- break;
- case 12:
- buf.append('S');
- break;
- default:
- buf.append('J');
+ case 1:
+ buf.append('I');
+ break;
+ case 2:
+ buf.append('F');
+ break;
+ case 3:
+ buf.append('D');
+ break;
+ case 9:
+ buf.append('Z');
+ break;
+ case 10:
+ buf.append('B');
+ break;
+ case 11:
+ buf.append('C');
+ break;
+ case 12:
+ buf.append('S');
+ break;
+ default:
+ buf.append('J');
}
}
stackMap.putByte(7).putShort(cw.newClass(buf.toString()));
@@ -1891,8 +1814,7 @@ class MethodWriter extends MethodVisitor {
size += 8 + stackMap.length;
}
if (cattrs != null) {
- size += cattrs.getSize(cw, code.data, code.length, maxStack,
- maxLocals);
+ size += cattrs.getSize(cw, code.data, code.length, maxStack, maxLocals);
}
}
if (exceptionCount > 0) {
@@ -1950,14 +1872,11 @@ class MethodWriter extends MethodVisitor {
/**
* 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.
+ * @param out the byte vector into which the bytecode of this method must be copied.
*/
final void put(final ByteVector out) {
final int FACTOR = ClassWriter.TO_ACC_SYNTHETIC;
- int mask = ACC_CONSTRUCTOR | Opcodes.ACC_DEPRECATED
- | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+ int mask = ACC_CONSTRUCTOR | Opcodes.ACC_DEPRECATED | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
| ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / FACTOR);
out.putShort(access & ~mask).putShort(name).putShort(desc);
if (classReaderOffset != 0) {
@@ -2017,8 +1936,7 @@ class MethodWriter extends MethodVisitor {
size += 8 + stackMap.length;
}
if (cattrs != null) {
- size += cattrs.getSize(cw, code.data, code.length, maxStack,
- maxLocals);
+ size += cattrs.getSize(cw, code.data, code.length, maxStack, maxLocals);
}
out.putShort(cw.newUTF8("Code")).putInt(size);
out.putShort(maxStack).putShort(maxLocals);
@@ -2075,8 +1993,7 @@ class MethodWriter extends MethodVisitor {
}
}
if (exceptionCount > 0) {
- out.putShort(cw.newUTF8("Exceptions")).putInt(
- 2 * exceptionCount + 2);
+ out.putShort(cw.newUTF8("Exceptions")).putInt(2 * exceptionCount + 2);
out.putShort(exceptionCount);
for (int i = 0; i < exceptionCount; ++i) {
out.putShort(exceptions[i]);
@@ -2092,8 +2009,7 @@ class MethodWriter extends MethodVisitor {
out.putShort(cw.newUTF8("Deprecated")).putInt(0);
}
if (ClassReader.SIGNATURES && signature != null) {
- out.putShort(cw.newUTF8("Signature")).putInt(2)
- .putShort(cw.newUTF8(signature));
+ out.putShort(cw.newUTF8("Signature")).putInt(2).putShort(cw.newUTF8(signature));
}
if (ClassReader.ANNOTATIONS && annd != null) {
out.putShort(cw.newUTF8("AnnotationDefault"));
@@ -2126,50 +2042,44 @@ class MethodWriter extends MethodVisitor {
// ------------------------------------------------------------------------
/**
- * Resizes and replaces the temporary instructions inserted by
- * {@link Label#resolve} for wide forward jumps, while keeping jump offsets
- * and instruction addresses consistent. This may require to resize other
- * existing instructions, or even to introduce new instructions: for
- * example, increasing the size of an instruction by 2 at the middle of a
- * method can increases the offset of an IFEQ instruction from 32766 to
- * 32768, in which case IFEQ 32766 must be replaced with IFNEQ 8 GOTO_W
- * 32765. This, in turn, may require to increase the size of another jump
- * instruction, and so on... All these operations are handled automatically
- * by this method.
+ * Resizes and replaces the temporary instructions inserted by {@link Label#resolve} for wide
+ * forward jumps, while keeping jump offsets and instruction addresses consistent. This may
+ * require to resize other existing instructions, or even to introduce new instructions: for
+ * example, increasing the size of an instruction by 2 at the middle of a method can increases
+ * the offset of an IFEQ instruction from 32766 to 32768, in which case IFEQ 32766 must be
+ * replaced with IFNEQ 8 GOTO_W 32765. This, in turn, may require to increase the size of
+ * another jump instruction, and so on... All these operations are handled automatically by this
+ * method.
*
- * This method must be called after all the method that is being built
- * has been visited . In particular, the {@link Label Label} objects used
- * to construct the method are no longer valid after this method has been
- * called.
+ * This method must be called after all the method that is being built has been visited .
+ * In particular, the {@link Label Label} objects used to construct the method are no longer
+ * valid after this method has been called.
*/
private void resizeInstructions() {
byte[] b = code.data; // bytecode of the method
int u, v, label; // indexes in b
int i, j; // loop indexes
/*
- * 1st step: As explained above, resizing an instruction may require to
- * resize another one, which may require to resize yet another one, and
- * 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:
+ * 1st step: As explained above, resizing an instruction may require to resize another one,
+ * which may require to resize yet another one, and 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!).
+ * 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.
+ * 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
- * convergence of the algorithm, the number of bytes to be added or
- * removed from these instructions is over estimated during the previous
- * loop, and computed exactly only after the loop is finished (this
- * requires another pass to parse the bytecode of the method).
+ * 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 convergence of the algorithm, the number of bytes to be added or
+ * removed from these instructions is over estimated during the previous loop, and computed
+ * exactly only after the loop is finished (this requires another pass to parse the bytecode
+ * of the method).
*/
int[] allIndexes = new int[0]; // copy of indexes
int[] allSizes = new int[0]; // copy of sizes
@@ -2190,118 +2100,116 @@ class MethodWriter extends MethodVisitor {
int insert = 0; // bytes to be added after this instruction
switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- if (opcode > 201) {
- // converts temporary opcodes 202 to 217, 218 and
- // 219 to IFEQ ... JSR (inclusive), IFNULL and
- // IFNONNULL
- opcode = opcode < 218 ? opcode - 49 : opcode - 20;
- label = u + readUnsignedShort(b, u + 1);
- } else {
- label = u + readShort(b, u + 1);
- }
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- if (newOffset < Short.MIN_VALUE
- || newOffset > Short.MAX_VALUE) {
- if (!resize[u]) {
- if (opcode == Opcodes.GOTO || opcode == Opcodes.JSR) {
- // two additional bytes will be required to
- // replace this GOTO or JSR instruction with
- // a GOTO_W or a JSR_W
- insert = 2;
- } else {
- // five additional bytes will be required to
- // replace this IFxxx instruction with
- // IFNOTxxx GOTO_W , where IFNOTxxx
- // is the "opposite" opcode of IFxxx (i.e.,
- // IFNE for IFEQ) and where designates
- // the instruction just after the GOTO_W.
- insert = 5;
+ case ClassWriter.NOARG_INSN:
+ case ClassWriter.IMPLVAR_INSN:
+ u += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ if (opcode > 201) {
+ // converts temporary opcodes 202 to 217, 218 and
+ // 219 to IFEQ ... JSR (inclusive), IFNULL and
+ // IFNONNULL
+ opcode = opcode < 218 ? opcode - 49 : opcode - 20;
+ label = u + readUnsignedShort(b, u + 1);
+ } else {
+ label = u + readShort(b, u + 1);
+ }
+ newOffset = getNewOffset(allIndexes, allSizes, u, label);
+ if (newOffset < Short.MIN_VALUE || newOffset > Short.MAX_VALUE) {
+ if (!resize[u]) {
+ if (opcode == Opcodes.GOTO || opcode == Opcodes.JSR) {
+ // two additional bytes will be required to
+ // replace this GOTO or JSR instruction with
+ // a GOTO_W or a JSR_W
+ insert = 2;
+ } else {
+ // five additional bytes will be required to
+ // replace this IFxxx instruction with
+ // IFNOTxxx GOTO_W , where IFNOTxxx
+ // is the "opposite" opcode of IFxxx (i.e.,
+ // IFNE for IFEQ) and where designates
+ // the instruction just after the GOTO_W.
+ insert = 5;
+ }
+ resize[u] = true;
}
+ }
+ u += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ u += 5;
+ break;
+ case ClassWriter.TABL_INSN:
+ if (state == 1) {
+ // true number of bytes to be added (or removed)
+ // from this instruction = (future number of padding
+ // bytes - current number of padding byte) -
+ // previously over estimated variation =
+ // = ((3 - newOffset%4) - (3 - u%4)) - u%4
+ // = (-newOffset%4 + u%4) - u%4
+ // = -(newOffset & 3)
+ newOffset = getNewOffset(allIndexes, allSizes, 0, u);
+ insert = -(newOffset & 3);
+ } else if (!resize[u]) {
+ // over estimation of the number of bytes to be
+ // added to this instruction = 3 - current number
+ // of padding bytes = 3 - (3 - u%4) = u%4 = u & 3
+ insert = u & 3;
resize[u] = true;
}
- }
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- u += 5;
- break;
- case ClassWriter.TABL_INSN:
- if (state == 1) {
- // true number of bytes to be added (or removed)
- // from this instruction = (future number of padding
- // bytes - current number of padding byte) -
- // previously over estimated variation =
- // = ((3 - newOffset%4) - (3 - u%4)) - u%4
- // = (-newOffset%4 + u%4) - u%4
- // = -(newOffset & 3)
- newOffset = getNewOffset(allIndexes, allSizes, 0, u);
- insert = -(newOffset & 3);
- } else if (!resize[u]) {
- // over estimation of the number of bytes to be
- // added to this instruction = 3 - current number
- // of padding bytes = 3 - (3 - u%4) = u%4 = u & 3
- insert = u & 3;
- resize[u] = true;
- }
- // skips instruction
- u = u + 4 - (u & 3);
- u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
- break;
- case ClassWriter.LOOK_INSN:
- if (state == 1) {
- // like TABL_INSN
- newOffset = getNewOffset(allIndexes, allSizes, 0, u);
- insert = -(newOffset & 3);
- } else if (!resize[u]) {
- // like TABL_INSN
- insert = u & 3;
- resize[u] = true;
- }
- // skips instruction
- u = u + 4 - (u & 3);
- u += 8 * readInt(b, u + 4) + 8;
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- u += 6;
- } else {
+ // skips instruction
+ u = u + 4 - (u & 3);
+ u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
+ break;
+ case ClassWriter.LOOK_INSN:
+ if (state == 1) {
+ // like TABL_INSN
+ newOffset = getNewOffset(allIndexes, allSizes, 0, u);
+ insert = -(newOffset & 3);
+ } else if (!resize[u]) {
+ // like TABL_INSN
+ insert = u & 3;
+ resize[u] = true;
+ }
+ // skips instruction
+ u = u + 4 - (u & 3);
+ u += 8 * readInt(b, u + 4) + 8;
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[u + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ u += 6;
+ } else {
+ u += 4;
+ }
+ break;
+ case ClassWriter.VAR_INSN:
+ case ClassWriter.SBYTE_INSN:
+ case ClassWriter.LDC_INSN:
+ u += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ case ClassWriter.LDCW_INSN:
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.TYPE_INSN:
+ case ClassWriter.IINC_INSN:
+ u += 3;
+ break;
+ case ClassWriter.ITFMETH_INSN:
+ case ClassWriter.INDYMETH_INSN:
+ u += 5;
+ break;
+ // case ClassWriter.MANA_INSN:
+ default:
u += 4;
- }
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- u += 3;
- break;
- case ClassWriter.ITFMETH_INSN:
- case ClassWriter.INDYMETH_INSN:
- u += 5;
- break;
- // case ClassWriter.MANA_INSN:
- default:
- u += 4;
- break;
+ break;
}
if (insert != 0) {
// adds a new (u, insert) entry in the allIndexes and
// allSizes arrays
int[] newIndexes = new int[allIndexes.length + 1];
int[] newSizes = new int[allSizes.length + 1];
- System.arraycopy(allIndexes, 0, newIndexes, 0,
- allIndexes.length);
+ System.arraycopy(allIndexes, 0, newIndexes, 0, allIndexes.length);
System.arraycopy(allSizes, 0, newSizes, 0, allSizes.length);
newIndexes[allIndexes.length] = u;
newSizes[allSizes.length] = insert;
@@ -2327,135 +2235,134 @@ class MethodWriter extends MethodVisitor {
while (u < code.length) {
int opcode = b[u] & 0xFF;
switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- newCode.putByte(opcode);
- u += 1;
- break;
- case ClassWriter.LABEL_INSN:
- if (opcode > 201) {
- // changes temporary opcodes 202 to 217 (inclusive), 218
- // and 219 to IFEQ ... JSR (inclusive), IFNULL and
- // IFNONNULL
- opcode = opcode < 218 ? opcode - 49 : opcode - 20;
- label = u + readUnsignedShort(b, u + 1);
- } else {
- label = u + readShort(b, u + 1);
- }
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- if (resize[u]) {
- // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
- // with IFNOTxxx GOTO_W , where IFNOTxxx is
- // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
- // and where designates the instruction just after
- // the GOTO_W.
- if (opcode == Opcodes.GOTO) {
- newCode.putByte(200); // GOTO_W
- } else if (opcode == Opcodes.JSR) {
- newCode.putByte(201); // JSR_W
- } else {
- newCode.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1
- : opcode ^ 1);
- newCode.putShort(8); // jump offset
- newCode.putByte(200); // GOTO_W
- // newOffset now computed from start of GOTO_W
- newOffset -= 3;
- }
- newCode.putInt(newOffset);
- } else {
+ case ClassWriter.NOARG_INSN:
+ case ClassWriter.IMPLVAR_INSN:
newCode.putByte(opcode);
- newCode.putShort(newOffset);
- }
- u += 3;
- break;
- case ClassWriter.LABELW_INSN:
- label = u + readInt(b, u + 1);
- newOffset = getNewOffset(allIndexes, allSizes, u, label);
- newCode.putByte(opcode);
- newCode.putInt(newOffset);
- u += 5;
- break;
- case ClassWriter.TABL_INSN:
- // skips 0 to 3 padding bytes
- v = u;
- u = u + 4 - (v & 3);
- // reads and copies instruction
- newCode.putByte(Opcodes.TABLESWITCH);
- newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- j = readInt(b, u);
- u += 4;
- newCode.putInt(j);
- j = readInt(b, u) - j + 1;
- u += 4;
- newCode.putInt(readInt(b, u - 4));
- for (; j > 0; --j) {
+ u += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ if (opcode > 201) {
+ // changes temporary opcodes 202 to 217 (inclusive), 218
+ // and 219 to IFEQ ... JSR (inclusive), IFNULL and
+ // IFNONNULL
+ opcode = opcode < 218 ? opcode - 49 : opcode - 20;
+ label = u + readUnsignedShort(b, u + 1);
+ } else {
+ label = u + readShort(b, u + 1);
+ }
+ newOffset = getNewOffset(allIndexes, allSizes, u, label);
+ if (resize[u]) {
+ // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
+ // with IFNOTxxx GOTO_W , where IFNOTxxx is
+ // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
+ // and where designates the instruction just after
+ // the GOTO_W.
+ if (opcode == Opcodes.GOTO) {
+ newCode.putByte(200); // GOTO_W
+ } else if (opcode == Opcodes.JSR) {
+ newCode.putByte(201); // JSR_W
+ } else {
+ newCode.putByte(opcode <= 166 ? ((opcode + 1) ^ 1) - 1 : opcode ^ 1);
+ newCode.putShort(8); // jump offset
+ newCode.putByte(200); // GOTO_W
+ // newOffset now computed from start of GOTO_W
+ newOffset -= 3;
+ }
+ newCode.putInt(newOffset);
+ } else {
+ newCode.putByte(opcode);
+ newCode.putShort(newOffset);
+ }
+ u += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ label = u + readInt(b, u + 1);
+ newOffset = getNewOffset(allIndexes, allSizes, u, label);
+ newCode.putByte(opcode);
+ newCode.putInt(newOffset);
+ u += 5;
+ break;
+ case ClassWriter.TABL_INSN:
+ // skips 0 to 3 padding bytes
+ v = u;
+ u = u + 4 - (v & 3);
+ // reads and copies instruction
+ newCode.putByte(Opcodes.TABLESWITCH);
+ newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
label = v + readInt(b, u);
u += 4;
newOffset = getNewOffset(allIndexes, allSizes, v, label);
newCode.putInt(newOffset);
- }
- break;
- case ClassWriter.LOOK_INSN:
- // skips 0 to 3 padding bytes
- v = u;
- u = u + 4 - (v & 3);
- // reads and copies instruction
- newCode.putByte(Opcodes.LOOKUPSWITCH);
- newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
- label = v + readInt(b, u);
- u += 4;
- newOffset = getNewOffset(allIndexes, allSizes, v, label);
- newCode.putInt(newOffset);
- j = readInt(b, u);
- u += 4;
- newCode.putInt(j);
- for (; j > 0; --j) {
- newCode.putInt(readInt(b, u));
+ j = readInt(b, u);
u += 4;
+ newCode.putInt(j);
+ j = readInt(b, u) - j + 1;
+ u += 4;
+ newCode.putInt(readInt(b, u - 4));
+ for (; j > 0; --j) {
+ label = v + readInt(b, u);
+ u += 4;
+ newOffset = getNewOffset(allIndexes, allSizes, v, label);
+ newCode.putInt(newOffset);
+ }
+ break;
+ case ClassWriter.LOOK_INSN:
+ // skips 0 to 3 padding bytes
+ v = u;
+ u = u + 4 - (v & 3);
+ // reads and copies instruction
+ newCode.putByte(Opcodes.LOOKUPSWITCH);
+ newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
label = v + readInt(b, u);
u += 4;
newOffset = getNewOffset(allIndexes, allSizes, v, label);
newCode.putInt(newOffset);
- }
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[u + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- newCode.putByteArray(b, u, 6);
- u += 6;
- } else {
+ j = readInt(b, u);
+ u += 4;
+ newCode.putInt(j);
+ for (; j > 0; --j) {
+ newCode.putInt(readInt(b, u));
+ u += 4;
+ label = v + readInt(b, u);
+ u += 4;
+ newOffset = getNewOffset(allIndexes, allSizes, v, label);
+ newCode.putInt(newOffset);
+ }
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[u + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ newCode.putByteArray(b, u, 6);
+ u += 6;
+ } else {
+ newCode.putByteArray(b, u, 4);
+ u += 4;
+ }
+ break;
+ case ClassWriter.VAR_INSN:
+ case ClassWriter.SBYTE_INSN:
+ case ClassWriter.LDC_INSN:
+ newCode.putByteArray(b, u, 2);
+ u += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ case ClassWriter.LDCW_INSN:
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.TYPE_INSN:
+ case ClassWriter.IINC_INSN:
+ newCode.putByteArray(b, u, 3);
+ u += 3;
+ break;
+ case ClassWriter.ITFMETH_INSN:
+ case ClassWriter.INDYMETH_INSN:
+ newCode.putByteArray(b, u, 5);
+ u += 5;
+ break;
+ // case MANA_INSN:
+ default:
newCode.putByteArray(b, u, 4);
u += 4;
- }
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- newCode.putByteArray(b, u, 2);
- u += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- newCode.putByteArray(b, u, 3);
- u += 3;
- break;
- case ClassWriter.ITFMETH_INSN:
- case ClassWriter.INDYMETH_INSN:
- newCode.putByteArray(b, u, 5);
- u += 5;
- break;
- // case MANA_INSN:
- default:
- newCode.putByteArray(b, u, 4);
- u += 4;
- break;
+ break;
}
}
@@ -2474,8 +2381,8 @@ class MethodWriter extends MethodVisitor {
Label l = labels;
while (l != null) {
/*
- * here we need the original label position. getNewOffset
- * must therefore never have been called for this label.
+ * here we need the original label position. getNewOffset must therefore never
+ * have been called for this label.
*/
u = l.position - 3;
if ((l.status & Label.STORE) != 0 || (u >= 0 && resize[u])) {
@@ -2487,18 +2394,15 @@ class MethodWriter extends MethodVisitor {
}
} else {
/*
- * Resizing an existing stack map frame table is really hard.
- * Not only the table must be parsed to update the offets, but
- * new frames may be needed for jump instructions that were
- * inserted by this method. And updating the offsets or
- * inserting frames can change the format of the following
- * frames, in case of packed frames. In practice the whole table
- * must be recomputed. For this the frames are marked as
- * potentially invalid. This will cause the whole class to be
- * reread and rewritten with the COMPUTE_FRAMES option (see the
- * ClassWriter.toByteArray method). This is not very efficient
- * but is much easier and requires much less code than any other
- * method I can think of.
+ * Resizing an existing stack map frame table is really hard. Not only the table
+ * must be parsed to update the offets, but new frames may be needed for jump
+ * instructions that were inserted by this method. And updating the offsets or
+ * inserting frames can change the format of the following frames, in case of packed
+ * frames. In practice the whole table must be recomputed. For this the frames are
+ * marked as potentially invalid. This will cause the whole class to be reread and
+ * rewritten with the COMPUTE_FRAMES option (see the ClassWriter.toByteArray
+ * method). This is not very efficient but is much easier and requires much less
+ * code than any other method I can think of.
*/
cw.invalidFrames = true;
}
@@ -2523,8 +2427,7 @@ class MethodWriter extends MethodVisitor {
newOffset = getNewOffset(allIndexes, allSizes, 0, label);
writeShort(b, u, newOffset);
label += readUnsignedShort(b, u + 2);
- newOffset = getNewOffset(allIndexes, allSizes, 0, label)
- - newOffset;
+ newOffset = getNewOffset(allIndexes, allSizes, 0, label) - newOffset;
writeShort(b, u + 2, newOffset);
u += 10;
}
@@ -2534,11 +2437,7 @@ class MethodWriter extends MethodVisitor {
b = lineNumber.data;
u = 0;
while (u < lineNumber.length) {
- writeShort(
- b,
- u,
- getNewOffset(allIndexes, allSizes, 0,
- readUnsignedShort(b, u)));
+ writeShort(b, u, getNewOffset(allIndexes, allSizes, 0, readUnsignedShort(b, u)));
u += 4;
}
}
@@ -2561,10 +2460,8 @@ class MethodWriter extends MethodVisitor {
/**
* Reads an unsigned short value in the given byte array.
*
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
+ * @param b a byte array.
+ * @param index the start index of the value to be read.
* @return the read value.
*/
static int readUnsignedShort(final byte[] b, final int index) {
@@ -2574,10 +2471,8 @@ class MethodWriter extends MethodVisitor {
/**
* Reads a signed short value in the given byte array.
*
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
+ * @param b a byte array.
+ * @param index the start index of the value to be read.
* @return the read value.
*/
static short readShort(final byte[] b, final int index) {
@@ -2587,10 +2482,8 @@ class MethodWriter extends MethodVisitor {
/**
* Reads a signed int value in the given byte array.
*
- * @param b
- * a byte array.
- * @param index
- * the start index of the value to be read.
+ * @param b a byte array.
+ * @param index the start index of the value to be read.
* @return the read value.
*/
static int readInt(final byte[] b, final int index) {
@@ -2601,12 +2494,9 @@ class MethodWriter extends MethodVisitor {
/**
* Writes a short value in the given byte array.
*
- * @param b
- * a byte array.
- * @param index
- * where the first byte of the short value must be written.
- * @param s
- * the value to be written in the given byte array.
+ * @param b a byte array.
+ * @param index where the first byte of the short value must be written.
+ * @param s the value to be written in the given byte array.
*/
static void writeShort(final byte[] b, final int index, final int s) {
b[index] = (byte) (s >>> 8);
@@ -2616,32 +2506,24 @@ class MethodWriter extends MethodVisitor {
/**
* Computes the future value of a bytecode offset.
*
- * 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').
+ * 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
- * byte, plus one (or, in other words, by the index of the
- * first byte of the next instruction).
- * @param sizes
- * the number of bytes to be added to the above
- * instructions. More precisely, for each i < len ,
- * sizes [i] bytes will be added at the end of the
- * instruction designated by indexes [i] or, if
- * sizes [i] is negative, the last |
- * sizes[i] | bytes of the instruction will be removed
- * (the instruction size must not become negative or
- * null).
- * @param begin
- * index of the first byte of the source instruction.
- * @param end
- * index of the first byte of the target instruction.
+ * @param indexes current positions of the instructions to be resized. Each instruction must be
+ * designated by the index of its last byte, plus one (or, in other words, by the
+ * index of the first byte of the next instruction).
+ * @param sizes the number of bytes to be added to the above instructions. More
+ * precisely, for each i < len , sizes [i] bytes will be added at the end
+ * of the instruction designated by indexes [i] or, if sizes [i] is
+ * negative, the last | sizes[i] | bytes of the instruction will be
+ * removed (the instruction size must not become negative or null).
+ * @param begin index of the first byte of the source instruction.
+ * @param end index of the first byte of the target instruction.
* @return the future value of the given bytecode offset.
*/
- static int getNewOffset(final int[] indexes, final int[] sizes,
- final int begin, final int end) {
+ static int getNewOffset(final int[] indexes, final int[] sizes, final int begin,
+ final int end) {
int offset = end - begin;
for (int i = 0; i < indexes.length; ++i) {
if (begin < indexes[i] && indexes[i] <= end) {
@@ -2658,25 +2540,17 @@ class MethodWriter extends MethodVisitor {
/**
* 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
- * byte, plus one (or, in other words, by the index of the
- * first byte of the next instruction).
- * @param sizes
- * the number of bytes to be added to the above
- * instructions. More precisely, for each i < len ,
- * sizes [i] bytes will be added at the end of the
- * instruction designated by indexes [i] or, if
- * sizes [i] is negative, the last |
- * sizes[i] | bytes of the instruction will be removed
- * (the instruction size must not become negative or
- * null).
- * @param label
- * the label whose offset must be updated.
+ * @param indexes current positions of the instructions to be resized. Each instruction must be
+ * designated by the index of its last byte, plus one (or, in other words, by the
+ * index of the first byte of the next instruction).
+ * @param sizes the number of bytes to be added to the above instructions. More
+ * precisely, for each i < len , sizes [i] bytes will be added at the end
+ * of the instruction designated by indexes [i] or, if sizes [i] is
+ * negative, the last | sizes[i] | bytes of the instruction will be
+ * removed (the instruction size must not become negative or null).
+ * @param label the label whose offset must be updated.
*/
- static void getNewOffset(final int[] indexes, final int[] sizes,
- final Label label) {
+ static void getNewOffset(final int[] indexes, final int[] sizes, final Label label) {
if ((label.status & Label.RESIZED) == 0) {
label.position = getNewOffset(indexes, sizes, 0, label.position);
label.status |= Label.RESIZED;
diff --git a/src/main/asm/org/objectweb/asm/Opcodes.java b/src/main/asm/org/objectweb/asm/Opcodes.java
index f9b6af1..dd7adf0 100644
--- a/src/main/asm/org/objectweb/asm/Opcodes.java
+++ b/src/main/asm/org/objectweb/asm/Opcodes.java
@@ -1,42 +1,32 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.objectweb.asm;
/**
- * Defines the JVM opcodes, access flags and array type codes. This interface
- * does not define all the JVM opcodes because some opcodes are automatically
- * handled. For example, the xLOAD and xSTORE opcodes are automatically replaced
- * by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and xSTORE_n
- * 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.
+ * Defines the JVM opcodes, access flags and array type codes. This interface does not define all
+ * the JVM opcodes because some opcodes are automatically handled. For example, the xLOAD and xSTORE
+ * opcodes are automatically replaced by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and
+ * xSTORE_n 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
@@ -120,28 +110,26 @@ public interface Opcodes {
int F_FULL = 0;
/**
- * Represents a compressed frame where locals are the same as the locals in
- * the previous frame, except that additional 1-3 locals are defined, and
- * with an empty stack.
+ * Represents a compressed frame where locals are the same as the locals in the previous frame,
+ * except that additional 1-3 locals are defined, and with an empty stack.
*/
int F_APPEND = 1;
/**
- * Represents a compressed frame where locals are the same as the locals in
- * the previous frame, except that the last 1-3 locals are absent and with
- * an empty stack.
+ * Represents a compressed frame where locals are the same as the locals in the previous frame,
+ * except that the last 1-3 locals are absent and with an empty stack.
*/
int F_CHOP = 2;
/**
- * Represents a compressed frame with exactly the same locals as the
- * previous frame and with an empty stack.
+ * Represents a compressed frame with exactly the same locals as the previous frame and with an
+ * empty stack.
*/
int F_SAME = 3;
/**
- * Represents a compressed frame with exactly the same locals as the
- * previous frame and with a single value on the stack.
+ * Represents a compressed frame with exactly the same locals as the previous frame and with a
+ * single value on the stack.
*/
int F_SAME1 = 4;
diff --git a/src/main/asm/org/objectweb/asm/Type.java b/src/main/asm/org/objectweb/asm/Type.java
index be69a2c..11e08b9 100644
--- a/src/main/asm/org/objectweb/asm/Type.java
+++ b/src/main/asm/org/objectweb/asm/Type.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.objectweb.asm;
@@ -33,8 +25,8 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
/**
- * A Java field or method type. This class can be used to make it easier to
- * manipulate type and method descriptors.
+ * 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
@@ -104,56 +96,56 @@ public class Type {
/**
* The void type.
*/
- public static final Type VOID_TYPE = new Type(VOID, null, ('V' << 24)
- | (5 << 16) | (0 << 8) | 0, 1);
+ public static final Type VOID_TYPE =
+ new Type(VOID, null, ('V' << 24) | (5 << 16) | (0 << 8) | 0, 1);
/**
* The boolean type.
*/
- public static final Type BOOLEAN_TYPE = new Type(BOOLEAN, null, ('Z' << 24)
- | (0 << 16) | (5 << 8) | 1, 1);
+ public static final Type BOOLEAN_TYPE =
+ new Type(BOOLEAN, null, ('Z' << 24) | (0 << 16) | (5 << 8) | 1, 1);
/**
* The char type.
*/
- public static final Type CHAR_TYPE = new Type(CHAR, null, ('C' << 24)
- | (0 << 16) | (6 << 8) | 1, 1);
+ public static final Type CHAR_TYPE =
+ new Type(CHAR, null, ('C' << 24) | (0 << 16) | (6 << 8) | 1, 1);
/**
* The byte type.
*/
- public static final Type BYTE_TYPE = new Type(BYTE, null, ('B' << 24)
- | (0 << 16) | (5 << 8) | 1, 1);
+ public static final Type BYTE_TYPE =
+ new Type(BYTE, null, ('B' << 24) | (0 << 16) | (5 << 8) | 1, 1);
/**
* The short type.
*/
- public static final Type SHORT_TYPE = new Type(SHORT, null, ('S' << 24)
- | (0 << 16) | (7 << 8) | 1, 1);
+ public static final Type SHORT_TYPE =
+ new Type(SHORT, null, ('S' << 24) | (0 << 16) | (7 << 8) | 1, 1);
/**
* The int type.
*/
- public static final Type INT_TYPE = new Type(INT, null, ('I' << 24)
- | (0 << 16) | (0 << 8) | 1, 1);
+ public static final Type INT_TYPE =
+ new Type(INT, null, ('I' << 24) | (0 << 16) | (0 << 8) | 1, 1);
/**
* The float type.
*/
- public static final Type FLOAT_TYPE = new Type(FLOAT, null, ('F' << 24)
- | (2 << 16) | (2 << 8) | 1, 1);
+ public static final Type FLOAT_TYPE =
+ new Type(FLOAT, null, ('F' << 24) | (2 << 16) | (2 << 8) | 1, 1);
/**
* The long type.
*/
- public static final Type LONG_TYPE = new Type(LONG, null, ('J' << 24)
- | (1 << 16) | (1 << 8) | 2, 1);
+ public static final Type LONG_TYPE =
+ new Type(LONG, null, ('J' << 24) | (1 << 16) | (1 << 8) | 2, 1);
/**
* The double type.
*/
- public static final Type DOUBLE_TYPE = new Type(DOUBLE, null, ('D' << 24)
- | (3 << 16) | (3 << 8) | 2, 1);
+ public static final Type DOUBLE_TYPE =
+ new Type(DOUBLE, null, ('D' << 24) | (3 << 16) | (3 << 8) | 2, 1);
// ------------------------------------------------------------------------
// Fields
@@ -165,16 +157,16 @@ public class Type {
private final int sort;
/**
- * A buffer containing the internal name of this Java type. This field is
- * only used for reference types.
+ * A buffer containing the internal name of this Java type. This field is only used for
+ * reference types.
*/
private final char[] buf;
/**
- * The offset of the internal name of this Java type in {@link #buf buf} or,
- * for primitive types, the size, descriptor and getOpcode offsets for this
- * type (byte 0 contains the size, byte 1 the descriptor, byte 2 the offset
- * for IALOAD or IASTORE, byte 3 the offset for all other instructions).
+ * The offset of the internal name of this Java type in {@link #buf buf} or, for primitive
+ * types, the size, descriptor and getOpcode offsets for this type (byte 0 contains the size,
+ * byte 1 the descriptor, byte 2 the offset for IALOAD or IASTORE, byte 3 the offset for all
+ * other instructions).
*/
private final int off;
@@ -190,14 +182,10 @@ public class Type {
/**
* Constructs a reference type.
*
- * @param sort
- * the sort of the reference type to be constructed.
- * @param buf
- * a buffer containing the descriptor of the previous type.
- * @param off
- * the offset of this descriptor in the previous buffer.
- * @param len
- * the length of this descriptor.
+ * @param sort the sort of the reference type to be constructed.
+ * @param buf a buffer containing the descriptor of the previous type.
+ * @param off the offset of this descriptor in the previous buffer.
+ * @param len the length of this descriptor.
*/
private Type(final int sort, final char[] buf, final int off, final int len) {
this.sort = sort;
@@ -209,8 +197,7 @@ public class Type {
/**
* Returns the Java type corresponding to the given type descriptor.
*
- * @param typeDescriptor
- * a field or method type descriptor.
+ * @param typeDescriptor a field or method type descriptor.
* @return the Java type corresponding to the given type descriptor.
*/
public static Type getType(final String typeDescriptor) {
@@ -220,8 +207,7 @@ public class Type {
/**
* Returns the Java type corresponding to the given internal name.
*
- * @param internalName
- * an internal name.
+ * @param internalName an internal name.
* @return the Java type corresponding to the given internal name.
*/
public static Type getObjectType(final String internalName) {
@@ -230,11 +216,10 @@ public class Type {
}
/**
- * Returns the Java type corresponding to the given method descriptor.
- * Equivalent to Type.getType(methodDescriptor)
.
+ * Returns the Java type corresponding to the given method descriptor. Equivalent to
+ * Type.getType(methodDescriptor)
.
*
- * @param methodDescriptor
- * a method descriptor.
+ * @param methodDescriptor a method descriptor.
* @return the Java type corresponding to the given method descriptor.
*/
public static Type getMethodType(final String methodDescriptor) {
@@ -242,26 +227,20 @@ public class Type {
}
/**
- * Returns the Java method type corresponding to the given argument and
- * return types.
+ * Returns the Java method type corresponding to the given argument and return types.
*
- * @param returnType
- * the return type of the method.
- * @param argumentTypes
- * the argument types of the method.
- * @return the Java type corresponding to the given argument and return
- * types.
+ * @param returnType the return type of the method.
+ * @param argumentTypes the argument types of the method.
+ * @return the Java type corresponding to the given argument and return types.
*/
- public static Type getMethodType(final Type returnType,
- final Type... argumentTypes) {
+ public static Type getMethodType(final Type returnType, final Type... argumentTypes) {
return getType(getMethodDescriptor(returnType, argumentTypes));
}
/**
* Returns the Java type corresponding to the given class.
*
- * @param c
- * a class.
+ * @param c a class.
* @return the Java type corresponding to the given class.
*/
public static Type getType(final Class> c) {
@@ -282,7 +261,7 @@ public class Type {
return DOUBLE_TYPE;
} else if (c == Float.TYPE) {
return FLOAT_TYPE;
- } else /* if (c == Long.TYPE) */{
+ } else /* if (c == Long.TYPE) */ {
return LONG_TYPE;
}
} else {
@@ -293,8 +272,7 @@ public class Type {
/**
* Returns the Java method type corresponding to the given constructor.
*
- * @param c
- * a {@link Constructor Constructor} object.
+ * @param c a {@link Constructor Constructor} object.
* @return the Java method type corresponding to the given constructor.
*/
public static Type getType(final Constructor> c) {
@@ -304,8 +282,7 @@ public class Type {
/**
* Returns the Java method type corresponding to the given method.
*
- * @param m
- * a {@link Method Method} object.
+ * @param m a {@link Method Method} object.
* @return the Java method type corresponding to the given method.
*/
public static Type getType(final Method m) {
@@ -313,13 +290,10 @@ public class Type {
}
/**
- * Returns the Java types corresponding to the argument types of the given
- * method descriptor.
+ * 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
- * method descriptor.
+ * @param methodDescriptor a method descriptor.
+ * @return the Java types corresponding to the argument types of the given method descriptor.
*/
public static Type[] getArgumentTypes(final String methodDescriptor) {
char[] buf = methodDescriptor.toCharArray();
@@ -349,13 +323,10 @@ public class Type {
}
/**
- * Returns the Java types corresponding to the argument types of the given
- * method.
+ * 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
- * method.
+ * @param method a method.
+ * @return the Java types corresponding to the argument types of the given method.
*/
public static Type[] getArgumentTypes(final Method method) {
Class>[] classes = method.getParameterTypes();
@@ -367,13 +338,10 @@ public class Type {
}
/**
- * Returns the Java type corresponding to the return type of the given
- * method descriptor.
+ * 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
- * method descriptor.
+ * @param methodDescriptor a method descriptor.
+ * @return the Java type corresponding to the return type of the given method descriptor.
*/
public static Type getReturnType(final String methodDescriptor) {
char[] buf = methodDescriptor.toCharArray();
@@ -381,13 +349,10 @@ public class Type {
}
/**
- * Returns the Java type corresponding to the return type of the given
- * method.
+ * 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
- * method.
+ * @param method a method.
+ * @return the Java type corresponding to the return type of the given method.
*/
public static Type getReturnType(final Method method) {
return getType(method.getReturnType());
@@ -396,13 +361,11 @@ public class Type {
/**
* 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
- * implicit this argument), argSize, and the size of its return
- * value, retSize, packed into a single int i =
- * (argSize << 2) | retSize (argSize is therefore equal to
- * i >> 2 , and retSize to i & 0x03 ).
+ * @param desc the descriptor of a method.
+ * @return the size of the arguments of the method (plus one for the implicit this argument),
+ * argSize, and the size of its return value, retSize, packed into a single int i =
+ * (argSize << 2) | retSize (argSize is therefore equal to i >> 2 , and
+ * retSize to i & 0x03 ).
*/
public static int getArgumentsAndReturnSizes(final String desc) {
int n = 1;
@@ -411,8 +374,7 @@ public class Type {
char car = desc.charAt(c++);
if (car == ')') {
car = desc.charAt(c);
- return n << 2
- | (car == 'V' ? 0 : (car == 'D' || car == 'J' ? 2 : 1));
+ return n << 2 | (car == 'V' ? 0 : (car == 'D' || car == 'J' ? 2 : 1));
} else if (car == 'L') {
while (desc.charAt(c++) != ';') {
}
@@ -433,58 +395,55 @@ public class Type {
}
/**
- * Returns the Java type corresponding to the given type descriptor. For
- * method descriptors, buf is supposed to contain nothing more than the
- * descriptor itself.
+ * 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
- * the offset of this descriptor in the previous buffer.
+ * @param buf a buffer containing a type descriptor.
+ * @param off the offset of this descriptor in the previous buffer.
* @return the Java type corresponding to the given type descriptor.
*/
private static Type getType(final char[] buf, final int off) {
int len;
switch (buf[off]) {
- case 'V':
- return VOID_TYPE;
- case 'Z':
- return BOOLEAN_TYPE;
- case 'C':
- return CHAR_TYPE;
- case 'B':
- return BYTE_TYPE;
- case 'S':
- return SHORT_TYPE;
- case 'I':
- return INT_TYPE;
- case 'F':
- return FLOAT_TYPE;
- case 'J':
- return LONG_TYPE;
- case 'D':
- return DOUBLE_TYPE;
- case '[':
- len = 1;
- while (buf[off + len] == '[') {
- ++len;
- }
- if (buf[off + len] == 'L') {
- ++len;
+ case 'V':
+ return VOID_TYPE;
+ case 'Z':
+ return BOOLEAN_TYPE;
+ case 'C':
+ return CHAR_TYPE;
+ case 'B':
+ return BYTE_TYPE;
+ case 'S':
+ return SHORT_TYPE;
+ case 'I':
+ return INT_TYPE;
+ case 'F':
+ return FLOAT_TYPE;
+ case 'J':
+ return LONG_TYPE;
+ case 'D':
+ return DOUBLE_TYPE;
+ case '[':
+ len = 1;
+ while (buf[off + len] == '[') {
+ ++len;
+ }
+ if (buf[off + len] == 'L') {
+ ++len;
+ while (buf[off + len] != ';') {
+ ++len;
+ }
+ }
+ return new Type(ARRAY, buf, off, len + 1);
+ case 'L':
+ len = 1;
while (buf[off + len] != ';') {
++len;
}
- }
- return new Type(ARRAY, buf, off, len + 1);
- case 'L':
- len = 1;
- while (buf[off + len] != ';') {
- ++len;
- }
- return new Type(OBJECT, buf, off + 1, len - 1);
+ return new Type(OBJECT, buf, off + 1, len - 1);
// case '(':
- default:
- return new Type(METHOD, buf, off, buf.length - off);
+ default:
+ return new Type(METHOD, buf, off, buf.length - off);
}
}
@@ -495,19 +454,18 @@ public class Type {
/**
* 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},
- * {@link #ARRAY ARRAY}, {@link #OBJECT OBJECT} or {@link #METHOD
- * METHOD}.
+ * @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}, {@link #ARRAY ARRAY}, {@link #OBJECT OBJECT} or
+ * {@link #METHOD METHOD}.
*/
public int getSort() {
return sort;
}
/**
- * Returns the number of dimensions of this array type. This method should
- * only be used for an array type.
+ * 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.
*/
@@ -520,8 +478,8 @@ public class Type {
}
/**
- * Returns the type of the elements of this array type. This method should
- * only be used for an array type.
+ * 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.
*/
@@ -530,49 +488,48 @@ public class Type {
}
/**
- * Returns the binary name of the class corresponding to this type. This
- * method must not be used on method types.
+ * 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() {
switch (sort) {
- case VOID:
- return "void";
- case BOOLEAN:
- return "boolean";
- case CHAR:
- return "char";
- case BYTE:
- return "byte";
- case SHORT:
- return "short";
- case INT:
- return "int";
- case FLOAT:
- return "float";
- case LONG:
- return "long";
- case DOUBLE:
- return "double";
- case ARRAY:
- StringBuffer b = new StringBuffer(getElementType().getClassName());
- for (int i = getDimensions(); i > 0; --i) {
- b.append("[]");
- }
- return b.toString();
- case OBJECT:
- return new String(buf, off, len).replace('/', '.');
- default:
- return null;
+ case VOID:
+ return "void";
+ case BOOLEAN:
+ return "boolean";
+ case CHAR:
+ return "char";
+ case BYTE:
+ return "byte";
+ case SHORT:
+ return "short";
+ case INT:
+ return "int";
+ case FLOAT:
+ return "float";
+ case LONG:
+ return "long";
+ case DOUBLE:
+ return "double";
+ case ARRAY:
+ StringBuffer b = new StringBuffer(getElementType().getClassName());
+ for (int i = getDimensions(); i > 0; --i) {
+ b.append("[]");
+ }
+ return b.toString();
+ case OBJECT:
+ return new String(buf, off, len).replace('/', '.');
+ default:
+ return null;
}
}
/**
- * Returns the internal name of the class corresponding to this object or
- * 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.
+ * Returns the internal name of the class corresponding to this object or 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.
*/
@@ -581,8 +538,8 @@ public class Type {
}
/**
- * Returns the argument types of methods of this type. This method should
- * only be used for method types.
+ * 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.
*/
@@ -591,8 +548,8 @@ public class Type {
}
/**
- * Returns the return type of methods of this type. This method should only
- * be used for method types.
+ * 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.
*/
@@ -601,14 +558,13 @@ public class Type {
}
/**
- * 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.
+ * 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 int i = (argSize << 2) | retSize
- * (argSize is therefore equal to i >> 2 , and retSize to
- * i & 0x03 ).
+ * @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 int i =
+ * (argSize << 2) | retSize (argSize is therefore equal to i >> 2 , and
+ * retSize to i & 0x03 ).
*/
public int getArgumentsAndReturnSizes() {
return getArgumentsAndReturnSizes(getDescriptor());
@@ -630,18 +586,13 @@ public class Type {
}
/**
- * Returns the descriptor corresponding to the given argument and return
- * types.
+ * Returns the descriptor corresponding to the given argument and return types.
*
- * @param returnType
- * the return type of the method.
- * @param argumentTypes
- * the argument types of the method.
- * @return the descriptor corresponding to the given argument and return
- * types.
+ * @param returnType the return type of the method.
+ * @param argumentTypes the argument types of the method.
+ * @return the descriptor corresponding to the given argument and return types.
*/
- public static String getMethodDescriptor(final Type returnType,
- final Type... argumentTypes) {
+ public static String getMethodDescriptor(final Type returnType, final Type... argumentTypes) {
StringBuffer buf = new StringBuffer();
buf.append('(');
for (int i = 0; i < argumentTypes.length; ++i) {
@@ -653,11 +604,9 @@ public class Type {
}
/**
- * Appends the descriptor corresponding to this Java type to the given
- * string buffer.
+ * 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.
+ * @param buf the string buffer to which the descriptor must be appended.
*/
private void getDescriptor(final StringBuffer buf) {
if (this.buf == null) {
@@ -679,12 +628,10 @@ public class Type {
// ------------------------------------------------------------------------
/**
- * 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 '/'.
+ * 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.
+ * @param c an object or array class.
* @return the internal name of the given class.
*/
public static String getInternalName(final Class> c) {
@@ -694,8 +641,7 @@ public class Type {
/**
* Returns the descriptor corresponding to the given Java type.
*
- * @param c
- * an object class, a primitive class or an array class.
+ * @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) {
@@ -707,8 +653,7 @@ public class Type {
/**
* Returns the descriptor corresponding to the given constructor.
*
- * @param c
- * a {@link Constructor Constructor} object.
+ * @param c a {@link Constructor Constructor} object.
* @return the descriptor of the given constructor.
*/
public static String getConstructorDescriptor(final Constructor> c) {
@@ -724,8 +669,7 @@ public class Type {
/**
* Returns the descriptor corresponding to the given method.
*
- * @param m
- * a {@link Method Method} object.
+ * @param m a {@link Method Method} object.
* @return the descriptor of the given method.
*/
public static String getMethodDescriptor(final Method m) {
@@ -743,10 +687,8 @@ public class Type {
/**
* 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.
+ * @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) {
Class> d = c;
@@ -769,7 +711,7 @@ public class Type {
car = 'D';
} else if (d == Float.TYPE) {
car = 'F';
- } else /* if (d == Long.TYPE) */{
+ } else /* if (d == Long.TYPE) */ {
car = 'J';
}
buf.append(car);
@@ -796,11 +738,10 @@ public class Type {
// ------------------------------------------------------------------------
/**
- * Returns the size of values of this type. This method must not be used for
- * method types.
+ * 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.
+ * @return the size of values of this type, i.e., 2 for long and double , 0 for
+ * void and 1 otherwise.
*/
public int getSize() {
// the size is in byte 0 of 'off' for primitive types (buf == null)
@@ -808,16 +749,15 @@ public class Type {
}
/**
- * Returns a JVM instruction opcode adapted to this Java type. This method
- * must not be used for method types.
+ * 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,
- * ISHL, ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
- * @return an opcode that is similar to the given opcode, but adapted to
- * this Java type. For example, if this type is float and
- * opcode is IRETURN, this method returns FRETURN.
+ * @param opcode a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD,
+ * IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and
+ * IRETURN.
+ * @return an opcode that is similar to the given opcode, but adapted to this Java type. For
+ * example, if this type is float and opcode is IRETURN, this method
+ * returns FRETURN.
*/
public int getOpcode(final int opcode) {
if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
@@ -838,8 +778,7 @@ public class Type {
/**
* Tests if the given object is equal to this type.
*
- * @param o
- * the object to be compared to this type.
+ * @param o the object to be compared to this type.
* @return true if the given object is equal to this type.
*/
@Override
diff --git a/src/main/asm/org/objectweb/asm/commons/AdviceAdapter.java b/src/main/asm/org/objectweb/asm/commons/AdviceAdapter.java
index c693215..c9c4c25 100644
--- a/src/main/asm/org/objectweb/asm/commons/AdviceAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/AdviceAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -41,17 +33,17 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
/**
- * A {@link org.objectweb.asm.MethodVisitor} to insert before, after and around
- * advices in methods and constructors.
+ * A {@link org.objectweb.asm.MethodVisitor} to insert before, after and around advices in methods
+ * and constructors.
*
* The behavior for constructors is like this:
*
*
- * as long as the INVOKESPECIAL for the object initialization has not been
- * reached, every bytecode instruction is dispatched in the ctor code visitor
+ * as long as the INVOKESPECIAL for the object initialization has not been reached, every
+ * bytecode instruction is dispatched in the ctor code visitor
*
- * when this one is reached, it is only added in the ctor code visitor and a
- * JP invoke is added
+ * when this one is reached, it is only added in the ctor code visitor and a JP invoke is
+ * added
*
* after that, only the other code visitor receives the instructions
*
@@ -81,20 +73,15 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
/**
* Creates a new {@link AdviceAdapter}.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param mv
- * the method visitor to which this adapter delegates calls.
- * @param access
- * the method's access flags (see {@link Opcodes}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param mv the method visitor to which this adapter delegates calls.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
*/
- protected AdviceAdapter(final int api, final MethodVisitor mv,
- final int access, final String name, final String desc) {
+ protected AdviceAdapter(final int api, final MethodVisitor mv, final int access,
+ final String name, final String desc) {
super(api, mv, access, name, desc);
methodAccess = access;
methodDesc = desc;
@@ -130,178 +117,178 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
if (constructor) {
int s;
switch (opcode) {
- case RETURN: // empty stack
- onMethodExit(opcode);
- break;
- case IRETURN: // 1 before n/a after
- case FRETURN: // 1 before n/a after
- case ARETURN: // 1 before n/a after
- case ATHROW: // 1 before n/a after
- popValue();
- onMethodExit(opcode);
- break;
- case LRETURN: // 2 before n/a after
- case DRETURN: // 2 before n/a after
- popValue();
- popValue();
- onMethodExit(opcode);
- break;
- case NOP:
- case LALOAD: // remove 2 add 2
- case DALOAD: // remove 2 add 2
- case LNEG:
- case DNEG:
- case FNEG:
- case INEG:
- case L2D:
- case D2L:
- case F2I:
- case I2B:
- case I2C:
- case I2S:
- case I2F:
- case ARRAYLENGTH:
- break;
- case ACONST_NULL:
- case ICONST_M1:
- case ICONST_0:
- case ICONST_1:
- case ICONST_2:
- case ICONST_3:
- case ICONST_4:
- case ICONST_5:
- case FCONST_0:
- case FCONST_1:
- case FCONST_2:
- case F2L: // 1 before 2 after
- case F2D:
- case I2L:
- case I2D:
- pushValue(OTHER);
- break;
- case LCONST_0:
- case LCONST_1:
- case DCONST_0:
- case DCONST_1:
- pushValue(OTHER);
- pushValue(OTHER);
- break;
- case IALOAD: // remove 2 add 1
- case FALOAD: // remove 2 add 1
- case AALOAD: // remove 2 add 1
- case BALOAD: // remove 2 add 1
- case CALOAD: // remove 2 add 1
- case SALOAD: // remove 2 add 1
- case POP:
- case IADD:
- case FADD:
- case ISUB:
- case LSHL: // 3 before 2 after
- case LSHR: // 3 before 2 after
- case LUSHR: // 3 before 2 after
- case L2I: // 2 before 1 after
- case L2F: // 2 before 1 after
- case D2I: // 2 before 1 after
- case D2F: // 2 before 1 after
- case FSUB:
- case FMUL:
- case FDIV:
- case FREM:
- case FCMPL: // 2 before 1 after
- case FCMPG: // 2 before 1 after
- case IMUL:
- case IDIV:
- case IREM:
- case ISHL:
- case ISHR:
- case IUSHR:
- case IAND:
- case IOR:
- case IXOR:
- case MONITORENTER:
- case MONITOREXIT:
- popValue();
- break;
- case POP2:
- case LSUB:
- case LMUL:
- case LDIV:
- case LREM:
- case LADD:
- case LAND:
- case LOR:
- case LXOR:
- case DADD:
- case DMUL:
- case DSUB:
- case DDIV:
- case DREM:
- popValue();
- popValue();
- break;
- case IASTORE:
- case FASTORE:
- case AASTORE:
- case BASTORE:
- case CASTORE:
- case SASTORE:
- case LCMP: // 4 before 1 after
- case DCMPL:
- case DCMPG:
- popValue();
- popValue();
- popValue();
- break;
- case LASTORE:
- case DASTORE:
- popValue();
- popValue();
- popValue();
- popValue();
- break;
- case DUP:
- pushValue(peekValue());
- break;
- case DUP_X1:
- s = stackFrame.size();
- stackFrame.add(s - 2, stackFrame.get(s - 1));
- break;
- case DUP_X2:
- s = stackFrame.size();
- stackFrame.add(s - 3, stackFrame.get(s - 1));
- break;
- case DUP2:
- s = stackFrame.size();
- stackFrame.add(s - 2, stackFrame.get(s - 1));
- stackFrame.add(s - 2, stackFrame.get(s - 1));
- break;
- case DUP2_X1:
- s = stackFrame.size();
- stackFrame.add(s - 3, stackFrame.get(s - 1));
- stackFrame.add(s - 3, stackFrame.get(s - 1));
- break;
- case DUP2_X2:
- s = stackFrame.size();
- stackFrame.add(s - 4, stackFrame.get(s - 1));
- stackFrame.add(s - 4, stackFrame.get(s - 1));
- break;
- case SWAP:
- s = stackFrame.size();
- stackFrame.add(s - 2, stackFrame.get(s - 1));
- stackFrame.remove(s);
- break;
+ case RETURN: // empty stack
+ onMethodExit(opcode);
+ break;
+ case IRETURN: // 1 before n/a after
+ case FRETURN: // 1 before n/a after
+ case ARETURN: // 1 before n/a after
+ case ATHROW: // 1 before n/a after
+ popValue();
+ onMethodExit(opcode);
+ break;
+ case LRETURN: // 2 before n/a after
+ case DRETURN: // 2 before n/a after
+ popValue();
+ popValue();
+ onMethodExit(opcode);
+ break;
+ case NOP:
+ case LALOAD: // remove 2 add 2
+ case DALOAD: // remove 2 add 2
+ case LNEG:
+ case DNEG:
+ case FNEG:
+ case INEG:
+ case L2D:
+ case D2L:
+ case F2I:
+ case I2B:
+ case I2C:
+ case I2S:
+ case I2F:
+ case ARRAYLENGTH:
+ break;
+ case ACONST_NULL:
+ case ICONST_M1:
+ case ICONST_0:
+ case ICONST_1:
+ case ICONST_2:
+ case ICONST_3:
+ case ICONST_4:
+ case ICONST_5:
+ case FCONST_0:
+ case FCONST_1:
+ case FCONST_2:
+ case F2L: // 1 before 2 after
+ case F2D:
+ case I2L:
+ case I2D:
+ pushValue(OTHER);
+ break;
+ case LCONST_0:
+ case LCONST_1:
+ case DCONST_0:
+ case DCONST_1:
+ pushValue(OTHER);
+ pushValue(OTHER);
+ break;
+ case IALOAD: // remove 2 add 1
+ case FALOAD: // remove 2 add 1
+ case AALOAD: // remove 2 add 1
+ case BALOAD: // remove 2 add 1
+ case CALOAD: // remove 2 add 1
+ case SALOAD: // remove 2 add 1
+ case POP:
+ case IADD:
+ case FADD:
+ case ISUB:
+ case LSHL: // 3 before 2 after
+ case LSHR: // 3 before 2 after
+ case LUSHR: // 3 before 2 after
+ case L2I: // 2 before 1 after
+ case L2F: // 2 before 1 after
+ case D2I: // 2 before 1 after
+ case D2F: // 2 before 1 after
+ case FSUB:
+ case FMUL:
+ case FDIV:
+ case FREM:
+ case FCMPL: // 2 before 1 after
+ case FCMPG: // 2 before 1 after
+ case IMUL:
+ case IDIV:
+ case IREM:
+ case ISHL:
+ case ISHR:
+ case IUSHR:
+ case IAND:
+ case IOR:
+ case IXOR:
+ case MONITORENTER:
+ case MONITOREXIT:
+ popValue();
+ break;
+ case POP2:
+ case LSUB:
+ case LMUL:
+ case LDIV:
+ case LREM:
+ case LADD:
+ case LAND:
+ case LOR:
+ case LXOR:
+ case DADD:
+ case DMUL:
+ case DSUB:
+ case DDIV:
+ case DREM:
+ popValue();
+ popValue();
+ break;
+ case IASTORE:
+ case FASTORE:
+ case AASTORE:
+ case BASTORE:
+ case CASTORE:
+ case SASTORE:
+ case LCMP: // 4 before 1 after
+ case DCMPL:
+ case DCMPG:
+ popValue();
+ popValue();
+ popValue();
+ break;
+ case LASTORE:
+ case DASTORE:
+ popValue();
+ popValue();
+ popValue();
+ popValue();
+ break;
+ case DUP:
+ pushValue(peekValue());
+ break;
+ case DUP_X1:
+ s = stackFrame.size();
+ stackFrame.add(s - 2, stackFrame.get(s - 1));
+ break;
+ case DUP_X2:
+ s = stackFrame.size();
+ stackFrame.add(s - 3, stackFrame.get(s - 1));
+ break;
+ case DUP2:
+ s = stackFrame.size();
+ stackFrame.add(s - 2, stackFrame.get(s - 1));
+ stackFrame.add(s - 2, stackFrame.get(s - 1));
+ break;
+ case DUP2_X1:
+ s = stackFrame.size();
+ stackFrame.add(s - 3, stackFrame.get(s - 1));
+ stackFrame.add(s - 3, stackFrame.get(s - 1));
+ break;
+ case DUP2_X2:
+ s = stackFrame.size();
+ stackFrame.add(s - 4, stackFrame.get(s - 1));
+ stackFrame.add(s - 4, stackFrame.get(s - 1));
+ break;
+ case SWAP:
+ s = stackFrame.size();
+ stackFrame.add(s - 2, stackFrame.get(s - 1));
+ stackFrame.remove(s);
+ break;
}
} else {
switch (opcode) {
- case RETURN:
- case IRETURN:
- case FRETURN:
- case ARETURN:
- case LRETURN:
- case DRETURN:
- case ATHROW:
- onMethodExit(opcode);
- break;
+ case RETURN:
+ case IRETURN:
+ case FRETURN:
+ case ARETURN:
+ case LRETURN:
+ case DRETURN:
+ case ATHROW:
+ onMethodExit(opcode);
+ break;
}
}
mv.visitInsn(opcode);
@@ -312,64 +299,64 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
super.visitVarInsn(opcode, var);
if (constructor) {
switch (opcode) {
- case ILOAD:
- case FLOAD:
- pushValue(OTHER);
- break;
- case LLOAD:
- case DLOAD:
- pushValue(OTHER);
- pushValue(OTHER);
- break;
- case ALOAD:
- pushValue(var == 0 ? THIS : OTHER);
- break;
- case ASTORE:
- case ISTORE:
- case FSTORE:
- popValue();
- break;
- case LSTORE:
- case DSTORE:
- popValue();
- popValue();
- break;
+ case ILOAD:
+ case FLOAD:
+ pushValue(OTHER);
+ break;
+ case LLOAD:
+ case DLOAD:
+ pushValue(OTHER);
+ pushValue(OTHER);
+ break;
+ case ALOAD:
+ pushValue(var == 0 ? THIS : OTHER);
+ break;
+ case ASTORE:
+ case ISTORE:
+ case FSTORE:
+ popValue();
+ break;
+ case LSTORE:
+ case DSTORE:
+ popValue();
+ popValue();
+ break;
}
}
}
@Override
- public void visitFieldInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitFieldInsn(final int opcode, final String owner, final String name,
+ final String desc) {
mv.visitFieldInsn(opcode, owner, name, desc);
if (constructor) {
char c = desc.charAt(0);
boolean longOrDouble = c == 'J' || c == 'D';
switch (opcode) {
- case GETSTATIC:
- pushValue(OTHER);
- if (longOrDouble) {
+ case GETSTATIC:
pushValue(OTHER);
- }
- break;
- case PUTSTATIC:
- popValue();
- if (longOrDouble) {
+ if (longOrDouble) {
+ pushValue(OTHER);
+ }
+ break;
+ case PUTSTATIC:
popValue();
- }
- break;
- case PUTFIELD:
- popValue();
- if (longOrDouble) {
+ if (longOrDouble) {
+ popValue();
+ }
+ break;
+ case PUTFIELD:
popValue();
- popValue();
- }
- break;
- // case GETFIELD:
- default:
- if (longOrDouble) {
- pushValue(OTHER);
- }
+ if (longOrDouble) {
+ popValue();
+ popValue();
+ }
+ break;
+ // case GETFIELD:
+ default:
+ if (longOrDouble) {
+ pushValue(OTHER);
+ }
}
}
}
@@ -414,8 +401,8 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
}
@Override
- public void visitMethodInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitMethodInsn(final int opcode, final String owner, final String name,
+ final String desc) {
mv.visitMethodInsn(opcode, owner, name, desc);
if (constructor) {
Type[] types = Type.getArgumentTypes(desc);
@@ -426,22 +413,22 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
}
}
switch (opcode) {
- // case INVOKESTATIC:
- // break;
- case INVOKEINTERFACE:
- case INVOKEVIRTUAL:
- popValue(); // objectref
- break;
- case INVOKESPECIAL:
- Object type = popValue(); // objectref
- if (type == THIS && !superInitialized) {
- onMethodEnter();
- superInitialized = true;
- // once super has been initialized it is no longer
- // necessary to keep track of stack state
- constructor = false;
- }
- break;
+ // case INVOKESTATIC:
+ // break;
+ case INVOKEINTERFACE:
+ case INVOKEVIRTUAL:
+ popValue(); // objectref
+ break;
+ case INVOKESPECIAL:
+ Object type = popValue(); // objectref
+ if (type == THIS && !superInitialized) {
+ onMethodEnter();
+ superInitialized = true;
+ // once super has been initialized it is no longer
+ // necessary to keep track of stack state
+ constructor = false;
+ }
+ break;
}
Type returnType = Type.getReturnType(desc);
@@ -455,8 +442,7 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
}
@Override
- public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
- Object... bsmArgs) {
+ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
if (constructor) {
Type[] types = Type.getArgumentTypes(desc);
@@ -482,38 +468,37 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
mv.visitJumpInsn(opcode, label);
if (constructor) {
switch (opcode) {
- case IFEQ:
- case IFNE:
- case IFLT:
- case IFGE:
- case IFGT:
- case IFLE:
- case IFNULL:
- case IFNONNULL:
- popValue();
- break;
- case IF_ICMPEQ:
- case IF_ICMPNE:
- case IF_ICMPLT:
- case IF_ICMPGE:
- case IF_ICMPGT:
- case IF_ICMPLE:
- case IF_ACMPEQ:
- case IF_ACMPNE:
- popValue();
- popValue();
- break;
- case JSR:
- pushValue(OTHER);
- break;
+ case IFEQ:
+ case IFNE:
+ case IFLT:
+ case IFGE:
+ case IFGT:
+ case IFLE:
+ case IFNULL:
+ case IFNONNULL:
+ popValue();
+ break;
+ case IF_ICMPEQ:
+ case IF_ICMPNE:
+ case IF_ICMPLT:
+ case IF_ICMPGE:
+ case IF_ICMPGT:
+ case IF_ICMPLE:
+ case IF_ACMPEQ:
+ case IF_ACMPNE:
+ popValue();
+ popValue();
+ break;
+ case JSR:
+ pushValue(OTHER);
+ break;
}
addBranch(label);
}
}
@Override
- public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
- final Label[] labels) {
+ public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
mv.visitLookupSwitchInsn(dflt, keys, labels);
if (constructor) {
popValue();
@@ -522,8 +507,8 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
}
@Override
- public void visitTableSwitchInsn(final int min, final int max,
- final Label dflt, final Label... labels) {
+ public void visitTableSwitchInsn(final int min, final int max, final Label dflt,
+ final Label... labels) {
mv.visitTableSwitchInsn(min, max, dflt, labels);
if (constructor) {
popValue();
@@ -532,8 +517,7 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
}
@Override
- public void visitTryCatchBlock(Label start, Label end, Label handler,
- String type) {
+ public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
super.visitTryCatchBlock(start, end, handler, type);
if (constructor && !branches.containsKey(handler)) {
List stackFrame = new ArrayList();
@@ -569,20 +553,18 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
}
/**
- * Called at the beginning of the method or after super class class call in
- * the constructor.
+ * Called at the beginning of the method or after super class class call in the constructor.
+ *
*
*
- * Custom code can use or change all the local variables, but should not
- * change state of the stack.
+ * Custom code can use or change all the local variables, but should not change state of the
+ * stack.
*/
- protected void onMethodEnter() {
- }
+ protected void onMethodEnter() {}
/**
- * Called before explicit exit from the method using either return or throw.
- * Top element on the stack contains the return value or exception instance.
- * For example:
+ * Called before explicit exit from the method using either return or throw. Top element on the
+ * stack contains the return value or exception instance. For example:
*
*
* public void onMethodExit(int opcode) {
@@ -610,16 +592,13 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
*
*
*
- * Custom code can use or change all the local variables, but should not
- * change state of the stack.
+ * Custom code can use or change all the local variables, but should not change state of the
+ * stack.
*
- * @param opcode
- * one of the RETURN, IRETURN, FRETURN, ARETURN, LRETURN, DRETURN
- * or ATHROW
+ * @param opcode one of the RETURN, IRETURN, FRETURN, ARETURN, LRETURN, DRETURN or ATHROW
*
*/
- protected void onMethodExit(int opcode) {
- }
+ protected void onMethodExit(int opcode) {}
// TODO onException, onMethodCall
}
diff --git a/src/main/asm/org/objectweb/asm/commons/AnalyzerAdapter.java b/src/main/asm/org/objectweb/asm/commons/AnalyzerAdapter.java
index 156af0c..a2d2f29 100644
--- a/src/main/asm/org/objectweb/asm/commons/AnalyzerAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/AnalyzerAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -42,65 +34,55 @@ import org.objectweb.asm.Type;
/**
* A {@link MethodVisitor} that keeps track of stack map frame changes between
- * {@link #visitFrame(int, int, Object[], int, Object[]) visitFrame} calls. This
- * adapter must be used with the
- * {@link org.objectweb.asm.ClassReader#EXPAND_FRAMES} option. Each
- * visitX instruction delegates to the next visitor in the chain, if any,
- * and then simulates the effect of this instruction on the stack map frame,
- * represented by {@link #locals} and {@link #stack}. The next visitor in the
- * chain can get the state of the stack map frame before each instruction
- * by reading the value of these fields in its visitX methods (this
- * requires a reference to the AnalyzerAdapter that is before it in the chain).
- * If this adapter is used with a class that does not contain stack map table
- * attributes (i.e., pre Java 6 classes) then this adapter may not be able to
- * compute the stack map frame for each instruction. In this case no exception
- * is thrown but the {@link #locals} and {@link #stack} fields will be null for
- * these instructions.
+ * {@link #visitFrame(int, int, Object[], int, Object[]) visitFrame} calls. This adapter must be
+ * used with the {@link org.objectweb.asm.ClassReader#EXPAND_FRAMES} option. Each visitX
+ * instruction delegates to the next visitor in the chain, if any, and then simulates the effect of
+ * this instruction on the stack map frame, represented by {@link #locals} and {@link #stack}. The
+ * next visitor in the chain can get the state of the stack map frame before each instruction
+ * by reading the value of these fields in its visitX methods (this requires a reference to
+ * the AnalyzerAdapter that is before it in the chain). If this adapter is used with a class that
+ * does not contain stack map table attributes (i.e., pre Java 6 classes) then this adapter may not
+ * be able to compute the stack map frame for each instruction. In this case no exception is thrown
+ * but the {@link #locals} and {@link #stack} fields will be null for these instructions.
*
* @author Eric Bruneton
*/
public class AnalyzerAdapter extends MethodVisitor {
/**
- * List
of the local variable slots for current execution
- * frame. 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
- * two elements, the second one being TOP). 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). This field is null for unreachable
- * instructions.
+ * List
of the local variable slots for current execution frame. 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 two elements, the
+ * second one being TOP). 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). This field is null for
+ * unreachable instructions.
*/
public List locals;
/**
- * List
of the operand stack slots for current execution frame.
- * 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
- * two elements, the second one being TOP). 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). This field is null for unreachable
- * instructions.
+ * List
of the operand stack slots for current execution frame. 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 two elements, the
+ * second one being TOP). 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). This field is null for
+ * unreachable instructions.
*/
public List stack;
/**
- * The labels that designate the next instruction to be visited. May be
- * null .
+ * The labels that designate the next instruction to be visited. May be null .
*/
private List labels;
/**
- * Information about uninitialized types in the current execution frame.
- * This map associates internal names to Label objects. Each label
- * designates a NEW instruction that created the currently uninitialized
- * types, and the associated internal name represents the NEW operand, i.e.
- * the final, initialized type value.
+ * Information about uninitialized types in the current execution frame. This map associates
+ * internal names to Label objects. Each label designates a NEW instruction that created the
+ * currently uninitialized types, and the associated internal name represents the NEW operand,
+ * i.e. the final, initialized type value.
*/
public Map uninitializedTypes;
@@ -120,49 +102,34 @@ public class AnalyzerAdapter extends MethodVisitor {
private String owner;
/**
- * Creates a new {@link AnalyzerAdapter}. Subclasses must not use this
- * constructor . Instead, they must use the
- * {@link #AnalyzerAdapter(int, String, int, String, String, MethodVisitor)}
- * version.
+ * Creates a new {@link AnalyzerAdapter}. Subclasses must not use this constructor .
+ * Instead, they must use the
+ * {@link #AnalyzerAdapter(int, String, int, String, String, MethodVisitor)} version.
*
- * @param owner
- * the owner's class name.
- * @param access
- * the method's access flags (see {@link Opcodes}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- * @param mv
- * the method visitor to which this adapter delegates calls. May
- * be null .
+ * @param owner the owner's class name.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ * @param mv the method visitor to which this adapter delegates calls. May be null .
*/
- public AnalyzerAdapter(final String owner, final int access,
- final String name, final String desc, final MethodVisitor mv) {
+ public AnalyzerAdapter(final String owner, final int access, final String name,
+ final String desc, final MethodVisitor mv) {
this(Opcodes.ASM4, owner, access, name, desc, mv);
}
/**
* Creates a new {@link AnalyzerAdapter}.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param owner
- * the owner's class name.
- * @param access
- * the method's access flags (see {@link Opcodes}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- * @param mv
- * the method visitor to which this adapter delegates calls. May
- * be null .
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param owner the owner's class name.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ * @param mv the method visitor to which this adapter delegates calls. May be null .
*/
- protected AnalyzerAdapter(final int api, final String owner,
- final int access, final String name, final String desc,
- final MethodVisitor mv) {
+ protected AnalyzerAdapter(final int api, final String owner, final int access,
+ final String name, final String desc, final MethodVisitor mv) {
super(api, mv);
this.owner = owner;
locals = new ArrayList();
@@ -180,37 +147,37 @@ public class AnalyzerAdapter extends MethodVisitor {
for (int i = 0; i < types.length; ++i) {
Type type = types[i];
switch (type.getSort()) {
- case Type.BOOLEAN:
- case Type.CHAR:
- case Type.BYTE:
- case Type.SHORT:
- case Type.INT:
- locals.add(Opcodes.INTEGER);
- break;
- case Type.FLOAT:
- locals.add(Opcodes.FLOAT);
- break;
- case Type.LONG:
- locals.add(Opcodes.LONG);
- locals.add(Opcodes.TOP);
- break;
- case Type.DOUBLE:
- locals.add(Opcodes.DOUBLE);
- locals.add(Opcodes.TOP);
- break;
- case Type.ARRAY:
- locals.add(types[i].getDescriptor());
- break;
- // case Type.OBJECT:
- default:
- locals.add(types[i].getInternalName());
+ case Type.BOOLEAN:
+ case Type.CHAR:
+ case Type.BYTE:
+ case Type.SHORT:
+ case Type.INT:
+ locals.add(Opcodes.INTEGER);
+ break;
+ case Type.FLOAT:
+ locals.add(Opcodes.FLOAT);
+ break;
+ case Type.LONG:
+ locals.add(Opcodes.LONG);
+ locals.add(Opcodes.TOP);
+ break;
+ case Type.DOUBLE:
+ locals.add(Opcodes.DOUBLE);
+ locals.add(Opcodes.TOP);
+ break;
+ case Type.ARRAY:
+ locals.add(types[i].getDescriptor());
+ break;
+ // case Type.OBJECT:
+ default:
+ locals.add(types[i].getInternalName());
}
}
}
@Override
- public void visitFrame(final int type, final int nLocal,
- final Object[] local, final int nStack, final Object[] stack) {
+ public void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack,
+ final Object[] stack) {
if (type != Opcodes.F_NEW) { // uncompressed frame
throw new IllegalStateException(
"ClassReader.accept() should be called with EXPAND_FRAMES flag");
@@ -249,8 +216,7 @@ public class AnalyzerAdapter extends MethodVisitor {
mv.visitInsn(opcode);
}
execute(opcode, 0, null);
- if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
- || opcode == Opcodes.ATHROW) {
+ if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN) || opcode == Opcodes.ATHROW) {
this.locals = null;
this.stack = null;
}
@@ -294,8 +260,8 @@ public class AnalyzerAdapter extends MethodVisitor {
}
@Override
- public void visitFieldInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitFieldInsn(final int opcode, final String owner, final String name,
+ final String desc) {
if (mv != null) {
mv.visitFieldInsn(opcode, owner, name, desc);
}
@@ -303,8 +269,8 @@ public class AnalyzerAdapter extends MethodVisitor {
}
@Override
- public void visitMethodInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitMethodInsn(final int opcode, final String owner, final String name,
+ final String desc) {
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc);
}
@@ -339,8 +305,7 @@ public class AnalyzerAdapter extends MethodVisitor {
}
@Override
- public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
- Object... bsmArgs) {
+ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
if (mv != null) {
mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
}
@@ -423,8 +388,8 @@ public class AnalyzerAdapter extends MethodVisitor {
}
@Override
- public void visitTableSwitchInsn(final int min, final int max,
- final Label dflt, final Label... labels) {
+ public void visitTableSwitchInsn(final int min, final int max, final Label dflt,
+ final Label... labels) {
if (mv != null) {
mv.visitTableSwitchInsn(min, max, dflt, labels);
}
@@ -434,8 +399,7 @@ public class AnalyzerAdapter extends MethodVisitor {
}
@Override
- public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
- final Label[] labels) {
+ public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
if (mv != null) {
mv.visitLookupSwitchInsn(dflt, keys, labels);
}
@@ -484,40 +448,40 @@ public class AnalyzerAdapter extends MethodVisitor {
private void pushDesc(final String desc) {
int index = desc.charAt(0) == '(' ? desc.indexOf(')') + 1 : 0;
switch (desc.charAt(index)) {
- case 'V':
- return;
- case 'Z':
- case 'C':
- case 'B':
- case 'S':
- case 'I':
- push(Opcodes.INTEGER);
- return;
- case 'F':
- push(Opcodes.FLOAT);
- return;
- case 'J':
- push(Opcodes.LONG);
- push(Opcodes.TOP);
- return;
- case 'D':
- push(Opcodes.DOUBLE);
- push(Opcodes.TOP);
- return;
- case '[':
- if (index == 0) {
- push(desc);
- } else {
- push(desc.substring(index, desc.length()));
- }
- break;
- // case 'L':
- default:
- if (index == 0) {
- push(desc.substring(1, desc.length() - 1));
- } else {
- push(desc.substring(index + 1, desc.length() - 1));
- }
+ case 'V':
+ return;
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ push(Opcodes.INTEGER);
+ return;
+ case 'F':
+ push(Opcodes.FLOAT);
+ return;
+ case 'J':
+ push(Opcodes.LONG);
+ push(Opcodes.TOP);
+ return;
+ case 'D':
+ push(Opcodes.DOUBLE);
+ push(Opcodes.TOP);
+ return;
+ case '[':
+ if (index == 0) {
+ push(desc);
+ } else {
+ push(desc.substring(index, desc.length()));
+ }
+ break;
+ // case 'L':
+ default:
+ if (index == 0) {
+ push(desc.substring(1, desc.length() - 1));
+ } else {
+ push(desc.substring(index + 1, desc.length() - 1));
+ }
}
}
@@ -556,364 +520,364 @@ public class AnalyzerAdapter extends MethodVisitor {
}
Object t1, t2, t3, t4;
switch (opcode) {
- case Opcodes.NOP:
- case Opcodes.INEG:
- case Opcodes.LNEG:
- case Opcodes.FNEG:
- case Opcodes.DNEG:
- case Opcodes.I2B:
- case Opcodes.I2C:
- case Opcodes.I2S:
- case Opcodes.GOTO:
- case Opcodes.RETURN:
- break;
- case Opcodes.ACONST_NULL:
- push(Opcodes.NULL);
- break;
- case Opcodes.ICONST_M1:
- case Opcodes.ICONST_0:
- case Opcodes.ICONST_1:
- case Opcodes.ICONST_2:
- case Opcodes.ICONST_3:
- case Opcodes.ICONST_4:
- case Opcodes.ICONST_5:
- case Opcodes.BIPUSH:
- case Opcodes.SIPUSH:
- push(Opcodes.INTEGER);
- break;
- case Opcodes.LCONST_0:
- case Opcodes.LCONST_1:
- push(Opcodes.LONG);
- push(Opcodes.TOP);
- break;
- case Opcodes.FCONST_0:
- case Opcodes.FCONST_1:
- case Opcodes.FCONST_2:
- push(Opcodes.FLOAT);
- break;
- case Opcodes.DCONST_0:
- case Opcodes.DCONST_1:
- push(Opcodes.DOUBLE);
- push(Opcodes.TOP);
- break;
- case Opcodes.ILOAD:
- case Opcodes.FLOAD:
- case Opcodes.ALOAD:
- push(get(iarg));
- break;
- case Opcodes.LLOAD:
- case Opcodes.DLOAD:
- push(get(iarg));
- push(Opcodes.TOP);
- break;
- case Opcodes.IALOAD:
- case Opcodes.BALOAD:
- case Opcodes.CALOAD:
- case Opcodes.SALOAD:
- pop(2);
- push(Opcodes.INTEGER);
- break;
- case Opcodes.LALOAD:
- case Opcodes.D2L:
- pop(2);
- push(Opcodes.LONG);
- push(Opcodes.TOP);
- break;
- case Opcodes.FALOAD:
- pop(2);
- push(Opcodes.FLOAT);
- break;
- case Opcodes.DALOAD:
- case Opcodes.L2D:
- pop(2);
- push(Opcodes.DOUBLE);
- push(Opcodes.TOP);
- break;
- case Opcodes.AALOAD:
- pop(1);
- t1 = pop();
- if (t1 instanceof String) {
- pushDesc(((String) t1).substring(1));
- } else {
- push("java/lang/Object");
- }
- break;
- case Opcodes.ISTORE:
- case Opcodes.FSTORE:
- case Opcodes.ASTORE:
- t1 = pop();
- set(iarg, t1);
- if (iarg > 0) {
- t2 = get(iarg - 1);
- if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
- set(iarg - 1, Opcodes.TOP);
+ case Opcodes.NOP:
+ case Opcodes.INEG:
+ case Opcodes.LNEG:
+ case Opcodes.FNEG:
+ case Opcodes.DNEG:
+ case Opcodes.I2B:
+ case Opcodes.I2C:
+ case Opcodes.I2S:
+ case Opcodes.GOTO:
+ case Opcodes.RETURN:
+ break;
+ case Opcodes.ACONST_NULL:
+ push(Opcodes.NULL);
+ break;
+ case Opcodes.ICONST_M1:
+ case Opcodes.ICONST_0:
+ case Opcodes.ICONST_1:
+ case Opcodes.ICONST_2:
+ case Opcodes.ICONST_3:
+ case Opcodes.ICONST_4:
+ case Opcodes.ICONST_5:
+ case Opcodes.BIPUSH:
+ case Opcodes.SIPUSH:
+ push(Opcodes.INTEGER);
+ break;
+ case Opcodes.LCONST_0:
+ case Opcodes.LCONST_1:
+ push(Opcodes.LONG);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.FCONST_0:
+ case Opcodes.FCONST_1:
+ case Opcodes.FCONST_2:
+ push(Opcodes.FLOAT);
+ break;
+ case Opcodes.DCONST_0:
+ case Opcodes.DCONST_1:
+ push(Opcodes.DOUBLE);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.ILOAD:
+ case Opcodes.FLOAD:
+ case Opcodes.ALOAD:
+ push(get(iarg));
+ break;
+ case Opcodes.LLOAD:
+ case Opcodes.DLOAD:
+ push(get(iarg));
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.IALOAD:
+ case Opcodes.BALOAD:
+ case Opcodes.CALOAD:
+ case Opcodes.SALOAD:
+ pop(2);
+ push(Opcodes.INTEGER);
+ break;
+ case Opcodes.LALOAD:
+ case Opcodes.D2L:
+ pop(2);
+ push(Opcodes.LONG);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.FALOAD:
+ pop(2);
+ push(Opcodes.FLOAT);
+ break;
+ case Opcodes.DALOAD:
+ case Opcodes.L2D:
+ pop(2);
+ push(Opcodes.DOUBLE);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.AALOAD:
+ pop(1);
+ t1 = pop();
+ if (t1 instanceof String) {
+ pushDesc(((String) t1).substring(1));
+ } else {
+ push("java/lang/Object");
}
- }
- break;
- case Opcodes.LSTORE:
- case Opcodes.DSTORE:
- pop(1);
- t1 = pop();
- set(iarg, t1);
- set(iarg + 1, Opcodes.TOP);
- if (iarg > 0) {
- t2 = get(iarg - 1);
- if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
- set(iarg - 1, Opcodes.TOP);
+ break;
+ case Opcodes.ISTORE:
+ case Opcodes.FSTORE:
+ case Opcodes.ASTORE:
+ t1 = pop();
+ set(iarg, t1);
+ if (iarg > 0) {
+ t2 = get(iarg - 1);
+ if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
+ set(iarg - 1, Opcodes.TOP);
+ }
}
- }
- break;
- case Opcodes.IASTORE:
- case Opcodes.BASTORE:
- case Opcodes.CASTORE:
- case Opcodes.SASTORE:
- case Opcodes.FASTORE:
- case Opcodes.AASTORE:
- pop(3);
- break;
- case Opcodes.LASTORE:
- case Opcodes.DASTORE:
- pop(4);
- break;
- case Opcodes.POP:
- case Opcodes.IFEQ:
- case Opcodes.IFNE:
- case Opcodes.IFLT:
- case Opcodes.IFGE:
- case Opcodes.IFGT:
- case Opcodes.IFLE:
- case Opcodes.IRETURN:
- case Opcodes.FRETURN:
- case Opcodes.ARETURN:
- case Opcodes.TABLESWITCH:
- case Opcodes.LOOKUPSWITCH:
- case Opcodes.ATHROW:
- case Opcodes.MONITORENTER:
- case Opcodes.MONITOREXIT:
- case Opcodes.IFNULL:
- case Opcodes.IFNONNULL:
- pop(1);
- break;
- case Opcodes.POP2:
- case Opcodes.IF_ICMPEQ:
- case Opcodes.IF_ICMPNE:
- case Opcodes.IF_ICMPLT:
- case Opcodes.IF_ICMPGE:
- case Opcodes.IF_ICMPGT:
- case Opcodes.IF_ICMPLE:
- case Opcodes.IF_ACMPEQ:
- case Opcodes.IF_ACMPNE:
- case Opcodes.LRETURN:
- case Opcodes.DRETURN:
- pop(2);
- break;
- case Opcodes.DUP:
- t1 = pop();
- push(t1);
- push(t1);
- break;
- case Opcodes.DUP_X1:
- t1 = pop();
- t2 = pop();
- push(t1);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP_X2:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- push(t1);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2:
- t1 = pop();
- t2 = pop();
- push(t2);
- push(t1);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2_X1:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- push(t2);
- push(t1);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2_X2:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- t4 = pop();
- push(t2);
- push(t1);
- push(t4);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.SWAP:
- t1 = pop();
- t2 = pop();
- push(t1);
- push(t2);
- break;
- case Opcodes.IADD:
- case Opcodes.ISUB:
- case Opcodes.IMUL:
- case Opcodes.IDIV:
- case Opcodes.IREM:
- case Opcodes.IAND:
- case Opcodes.IOR:
- case Opcodes.IXOR:
- case Opcodes.ISHL:
- case Opcodes.ISHR:
- case Opcodes.IUSHR:
- case Opcodes.L2I:
- case Opcodes.D2I:
- case Opcodes.FCMPL:
- case Opcodes.FCMPG:
- pop(2);
- push(Opcodes.INTEGER);
- break;
- case Opcodes.LADD:
- case Opcodes.LSUB:
- case Opcodes.LMUL:
- case Opcodes.LDIV:
- case Opcodes.LREM:
- case Opcodes.LAND:
- case Opcodes.LOR:
- case Opcodes.LXOR:
- pop(4);
- push(Opcodes.LONG);
- push(Opcodes.TOP);
- break;
- case Opcodes.FADD:
- case Opcodes.FSUB:
- case Opcodes.FMUL:
- case Opcodes.FDIV:
- case Opcodes.FREM:
- case Opcodes.L2F:
- case Opcodes.D2F:
- pop(2);
- push(Opcodes.FLOAT);
- break;
- case Opcodes.DADD:
- case Opcodes.DSUB:
- case Opcodes.DMUL:
- case Opcodes.DDIV:
- case Opcodes.DREM:
- pop(4);
- push(Opcodes.DOUBLE);
- push(Opcodes.TOP);
- break;
- case Opcodes.LSHL:
- case Opcodes.LSHR:
- case Opcodes.LUSHR:
- pop(3);
- push(Opcodes.LONG);
- push(Opcodes.TOP);
- break;
- case Opcodes.IINC:
- set(iarg, Opcodes.INTEGER);
- break;
- case Opcodes.I2L:
- case Opcodes.F2L:
- pop(1);
- push(Opcodes.LONG);
- push(Opcodes.TOP);
- break;
- case Opcodes.I2F:
- pop(1);
- push(Opcodes.FLOAT);
- break;
- case Opcodes.I2D:
- case Opcodes.F2D:
- pop(1);
- push(Opcodes.DOUBLE);
- push(Opcodes.TOP);
- break;
- case Opcodes.F2I:
- case Opcodes.ARRAYLENGTH:
- case Opcodes.INSTANCEOF:
- pop(1);
- push(Opcodes.INTEGER);
- break;
- case Opcodes.LCMP:
- case Opcodes.DCMPL:
- case Opcodes.DCMPG:
- pop(4);
- push(Opcodes.INTEGER);
- break;
- case Opcodes.JSR:
- case Opcodes.RET:
- throw new RuntimeException("JSR/RET are not supported");
- case Opcodes.GETSTATIC:
- pushDesc(sarg);
- break;
- case Opcodes.PUTSTATIC:
- pop(sarg);
- break;
- case Opcodes.GETFIELD:
- pop(1);
- pushDesc(sarg);
- break;
- case Opcodes.PUTFIELD:
- pop(sarg);
- pop();
- break;
- case Opcodes.NEW:
- push(labels.get(0));
- break;
- case Opcodes.NEWARRAY:
- pop();
- switch (iarg) {
- case Opcodes.T_BOOLEAN:
- pushDesc("[Z");
break;
- case Opcodes.T_CHAR:
- pushDesc("[C");
+ case Opcodes.LSTORE:
+ case Opcodes.DSTORE:
+ pop(1);
+ t1 = pop();
+ set(iarg, t1);
+ set(iarg + 1, Opcodes.TOP);
+ if (iarg > 0) {
+ t2 = get(iarg - 1);
+ if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
+ set(iarg - 1, Opcodes.TOP);
+ }
+ }
break;
- case Opcodes.T_BYTE:
- pushDesc("[B");
+ case Opcodes.IASTORE:
+ case Opcodes.BASTORE:
+ case Opcodes.CASTORE:
+ case Opcodes.SASTORE:
+ case Opcodes.FASTORE:
+ case Opcodes.AASTORE:
+ pop(3);
break;
- case Opcodes.T_SHORT:
- pushDesc("[S");
+ case Opcodes.LASTORE:
+ case Opcodes.DASTORE:
+ pop(4);
break;
- case Opcodes.T_INT:
- pushDesc("[I");
+ case Opcodes.POP:
+ case Opcodes.IFEQ:
+ case Opcodes.IFNE:
+ case Opcodes.IFLT:
+ case Opcodes.IFGE:
+ case Opcodes.IFGT:
+ case Opcodes.IFLE:
+ case Opcodes.IRETURN:
+ case Opcodes.FRETURN:
+ case Opcodes.ARETURN:
+ case Opcodes.TABLESWITCH:
+ case Opcodes.LOOKUPSWITCH:
+ case Opcodes.ATHROW:
+ case Opcodes.MONITORENTER:
+ case Opcodes.MONITOREXIT:
+ case Opcodes.IFNULL:
+ case Opcodes.IFNONNULL:
+ pop(1);
break;
- case Opcodes.T_FLOAT:
- pushDesc("[F");
+ case Opcodes.POP2:
+ case Opcodes.IF_ICMPEQ:
+ case Opcodes.IF_ICMPNE:
+ case Opcodes.IF_ICMPLT:
+ case Opcodes.IF_ICMPGE:
+ case Opcodes.IF_ICMPGT:
+ case Opcodes.IF_ICMPLE:
+ case Opcodes.IF_ACMPEQ:
+ case Opcodes.IF_ACMPNE:
+ case Opcodes.LRETURN:
+ case Opcodes.DRETURN:
+ pop(2);
break;
- case Opcodes.T_DOUBLE:
- pushDesc("[D");
+ case Opcodes.DUP:
+ t1 = pop();
+ push(t1);
+ push(t1);
break;
- // case Opcodes.T_LONG:
+ case Opcodes.DUP_X1:
+ t1 = pop();
+ t2 = pop();
+ push(t1);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP_X2:
+ t1 = pop();
+ t2 = pop();
+ t3 = pop();
+ push(t1);
+ push(t3);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP2:
+ t1 = pop();
+ t2 = pop();
+ push(t2);
+ push(t1);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP2_X1:
+ t1 = pop();
+ t2 = pop();
+ t3 = pop();
+ push(t2);
+ push(t1);
+ push(t3);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP2_X2:
+ t1 = pop();
+ t2 = pop();
+ t3 = pop();
+ t4 = pop();
+ push(t2);
+ push(t1);
+ push(t4);
+ push(t3);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.SWAP:
+ t1 = pop();
+ t2 = pop();
+ push(t1);
+ push(t2);
+ break;
+ case Opcodes.IADD:
+ case Opcodes.ISUB:
+ case Opcodes.IMUL:
+ case Opcodes.IDIV:
+ case Opcodes.IREM:
+ case Opcodes.IAND:
+ case Opcodes.IOR:
+ case Opcodes.IXOR:
+ case Opcodes.ISHL:
+ case Opcodes.ISHR:
+ case Opcodes.IUSHR:
+ case Opcodes.L2I:
+ case Opcodes.D2I:
+ case Opcodes.FCMPL:
+ case Opcodes.FCMPG:
+ pop(2);
+ push(Opcodes.INTEGER);
+ break;
+ case Opcodes.LADD:
+ case Opcodes.LSUB:
+ case Opcodes.LMUL:
+ case Opcodes.LDIV:
+ case Opcodes.LREM:
+ case Opcodes.LAND:
+ case Opcodes.LOR:
+ case Opcodes.LXOR:
+ pop(4);
+ push(Opcodes.LONG);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.FADD:
+ case Opcodes.FSUB:
+ case Opcodes.FMUL:
+ case Opcodes.FDIV:
+ case Opcodes.FREM:
+ case Opcodes.L2F:
+ case Opcodes.D2F:
+ pop(2);
+ push(Opcodes.FLOAT);
+ break;
+ case Opcodes.DADD:
+ case Opcodes.DSUB:
+ case Opcodes.DMUL:
+ case Opcodes.DDIV:
+ case Opcodes.DREM:
+ pop(4);
+ push(Opcodes.DOUBLE);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.LSHL:
+ case Opcodes.LSHR:
+ case Opcodes.LUSHR:
+ pop(3);
+ push(Opcodes.LONG);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.IINC:
+ set(iarg, Opcodes.INTEGER);
+ break;
+ case Opcodes.I2L:
+ case Opcodes.F2L:
+ pop(1);
+ push(Opcodes.LONG);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.I2F:
+ pop(1);
+ push(Opcodes.FLOAT);
+ break;
+ case Opcodes.I2D:
+ case Opcodes.F2D:
+ pop(1);
+ push(Opcodes.DOUBLE);
+ push(Opcodes.TOP);
+ break;
+ case Opcodes.F2I:
+ case Opcodes.ARRAYLENGTH:
+ case Opcodes.INSTANCEOF:
+ pop(1);
+ push(Opcodes.INTEGER);
+ break;
+ case Opcodes.LCMP:
+ case Opcodes.DCMPL:
+ case Opcodes.DCMPG:
+ pop(4);
+ push(Opcodes.INTEGER);
+ break;
+ case Opcodes.JSR:
+ case Opcodes.RET:
+ throw new RuntimeException("JSR/RET are not supported");
+ case Opcodes.GETSTATIC:
+ pushDesc(sarg);
+ break;
+ case Opcodes.PUTSTATIC:
+ pop(sarg);
+ break;
+ case Opcodes.GETFIELD:
+ pop(1);
+ pushDesc(sarg);
+ break;
+ case Opcodes.PUTFIELD:
+ pop(sarg);
+ pop();
+ break;
+ case Opcodes.NEW:
+ push(labels.get(0));
+ break;
+ case Opcodes.NEWARRAY:
+ pop();
+ switch (iarg) {
+ case Opcodes.T_BOOLEAN:
+ pushDesc("[Z");
+ break;
+ case Opcodes.T_CHAR:
+ pushDesc("[C");
+ break;
+ case Opcodes.T_BYTE:
+ pushDesc("[B");
+ break;
+ case Opcodes.T_SHORT:
+ pushDesc("[S");
+ break;
+ case Opcodes.T_INT:
+ pushDesc("[I");
+ break;
+ case Opcodes.T_FLOAT:
+ pushDesc("[F");
+ break;
+ case Opcodes.T_DOUBLE:
+ pushDesc("[D");
+ break;
+ // case Opcodes.T_LONG:
+ default:
+ pushDesc("[J");
+ break;
+ }
+ break;
+ case Opcodes.ANEWARRAY:
+ pop();
+ pushDesc("[" + Type.getObjectType(sarg));
+ break;
+ case Opcodes.CHECKCAST:
+ pop();
+ pushDesc(Type.getObjectType(sarg).getDescriptor());
+ break;
+ // case Opcodes.MULTIANEWARRAY:
default:
- pushDesc("[J");
+ pop(iarg);
+ pushDesc(sarg);
break;
- }
- break;
- case Opcodes.ANEWARRAY:
- pop();
- pushDesc("[" + Type.getObjectType(sarg));
- break;
- case Opcodes.CHECKCAST:
- pop();
- pushDesc(Type.getObjectType(sarg).getDescriptor());
- break;
- // case Opcodes.MULTIANEWARRAY:
- default:
- pop(iarg);
- pushDesc(sarg);
- break;
}
labels = null;
}
diff --git a/src/main/asm/org/objectweb/asm/commons/CodeSizeEvaluator.java b/src/main/asm/org/objectweb/asm/commons/CodeSizeEvaluator.java
index ddeb26d..e6df16c 100644
--- a/src/main/asm/org/objectweb/asm/commons/CodeSizeEvaluator.java
+++ b/src/main/asm/org/objectweb/asm/commons/CodeSizeEvaluator.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -111,8 +103,8 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
}
@Override
- public void visitFieldInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitFieldInsn(final int opcode, final String owner, final String name,
+ final String desc) {
minSize += 3;
maxSize += 3;
if (mv != null) {
@@ -121,8 +113,8 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
}
@Override
- public void visitMethodInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitMethodInsn(final int opcode, final String owner, final String name,
+ final String desc) {
if (opcode == INVOKEINTERFACE) {
minSize += 5;
maxSize += 5;
@@ -136,8 +128,7 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
}
@Override
- public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
- Object... bsmArgs) {
+ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
minSize += 5;
maxSize += 5;
if (mv != null) {
@@ -187,8 +178,8 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
}
@Override
- public void visitTableSwitchInsn(final int min, final int max,
- final Label dflt, final Label... labels) {
+ public void visitTableSwitchInsn(final int min, final int max, final Label dflt,
+ final Label... labels) {
minSize += 13 + labels.length * 4;
maxSize += 16 + labels.length * 4;
if (mv != null) {
@@ -197,8 +188,7 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
}
@Override
- public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
- final Label[] labels) {
+ public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
minSize += 9 + keys.length * 8;
maxSize += 12 + keys.length * 8;
if (mv != null) {
diff --git a/src/main/asm/org/objectweb/asm/commons/GeneratorAdapter.java b/src/main/asm/org/objectweb/asm/commons/GeneratorAdapter.java
index ea2a097..987bdb4 100644
--- a/src/main/asm/org/objectweb/asm/commons/GeneratorAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/GeneratorAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -41,8 +33,8 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
/**
- * A {@link org.objectweb.asm.MethodVisitor} with convenient methods to generate
- * code. For example, using this adapter, the class below
+ * A {@link org.objectweb.asm.MethodVisitor} with convenient methods to generate code. For example,
+ * using this adapter, the class below
*
*
* public class Example {
@@ -69,8 +61,7 @@ import org.objectweb.asm.Type;
* mg = new GeneratorAdapter(ACC_PUBLIC + ACC_STATIC, m, null, null, cw);
* mg.getStatic(Type.getType(System.class), "out", Type.getType(PrintStream.class));
* mg.push("Hello world!");
- * mg.invokeVirtual(Type.getType(PrintStream.class),
- * Method.getMethod("void println (String)"));
+ * mg.invokeVirtual(Type.getType(PrintStream.class), Method.getMethod("void println (String)"));
* mg.returnValue();
* mg.endMethod();
*
@@ -88,48 +79,35 @@ public class GeneratorAdapter extends LocalVariablesSorter {
private static final Type BYTE_TYPE = Type.getObjectType("java/lang/Byte");
- private static final Type BOOLEAN_TYPE = Type
- .getObjectType("java/lang/Boolean");
+ private static final Type BOOLEAN_TYPE = Type.getObjectType("java/lang/Boolean");
- private static final Type SHORT_TYPE = Type
- .getObjectType("java/lang/Short");
+ private static final Type SHORT_TYPE = Type.getObjectType("java/lang/Short");
- private static final Type CHARACTER_TYPE = Type
- .getObjectType("java/lang/Character");
+ private static final Type CHARACTER_TYPE = Type.getObjectType("java/lang/Character");
- private static final Type INTEGER_TYPE = Type
- .getObjectType("java/lang/Integer");
+ private static final Type INTEGER_TYPE = Type.getObjectType("java/lang/Integer");
- private static final Type FLOAT_TYPE = Type
- .getObjectType("java/lang/Float");
+ private static final Type FLOAT_TYPE = Type.getObjectType("java/lang/Float");
private static final Type LONG_TYPE = Type.getObjectType("java/lang/Long");
- private static final Type DOUBLE_TYPE = Type
- .getObjectType("java/lang/Double");
+ private static final Type DOUBLE_TYPE = Type.getObjectType("java/lang/Double");
- private static final Type NUMBER_TYPE = Type
- .getObjectType("java/lang/Number");
+ private static final Type NUMBER_TYPE = Type.getObjectType("java/lang/Number");
- private static final Type OBJECT_TYPE = Type
- .getObjectType("java/lang/Object");
+ private static final Type OBJECT_TYPE = Type.getObjectType("java/lang/Object");
- private static final Method BOOLEAN_VALUE = Method
- .getMethod("boolean booleanValue()");
+ private static final Method BOOLEAN_VALUE = Method.getMethod("boolean booleanValue()");
- private static final Method CHAR_VALUE = Method
- .getMethod("char charValue()");
+ private static final Method CHAR_VALUE = Method.getMethod("char charValue()");
private static final Method INT_VALUE = Method.getMethod("int intValue()");
- private static final Method FLOAT_VALUE = Method
- .getMethod("float floatValue()");
+ private static final Method FLOAT_VALUE = Method.getMethod("float floatValue()");
- private static final Method LONG_VALUE = Method
- .getMethod("long longValue()");
+ private static final Method LONG_VALUE = Method.getMethod("long longValue()");
- private static final Method DOUBLE_VALUE = Method
- .getMethod("double doubleValue()");
+ private static final Method DOUBLE_VALUE = Method.getMethod("double doubleValue()");
/**
* Constant for the {@link #math math} method.
@@ -242,42 +220,32 @@ public class GeneratorAdapter extends LocalVariablesSorter {
private final List localTypes = new ArrayList();
/**
- * Creates a new {@link GeneratorAdapter}. Subclasses must not use this
- * constructor . Instead, they must use the
- * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
+ * Creates a new {@link GeneratorAdapter}. Subclasses must not use this constructor .
+ * Instead, they must use the {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
* version.
*
- * @param mv
- * the method visitor to which this adapter delegates calls.
- * @param access
- * the method's access flags (see {@link Opcodes}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
+ * @param mv the method visitor to which this adapter delegates calls.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
*/
- public GeneratorAdapter(final MethodVisitor mv, final int access,
- final String name, final String desc) {
+ public GeneratorAdapter(final MethodVisitor mv, final int access, final String name,
+ final String desc) {
this(Opcodes.ASM4, mv, access, name, desc);
}
/**
* Creates a new {@link GeneratorAdapter}.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param mv
- * the method visitor to which this adapter delegates calls.
- * @param access
- * the method's access flags (see {@link Opcodes}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param mv the method visitor to which this adapter delegates calls.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
*/
- protected GeneratorAdapter(final int api, final MethodVisitor mv,
- final int access, final String name, final String desc) {
+ protected GeneratorAdapter(final int api, final MethodVisitor mv, final int access,
+ final String name, final String desc) {
super(api, access, desc, mv);
this.access = access;
this.returnType = Type.getReturnType(desc);
@@ -285,54 +253,39 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Creates a new {@link GeneratorAdapter}. Subclasses must not use this
- * constructor . Instead, they must use the
- * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
+ * Creates a new {@link GeneratorAdapter}. Subclasses must not use this constructor .
+ * Instead, they must use the {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
* version.
*
- * @param access
- * access flags of the adapted method.
- * @param method
- * the adapted method.
- * @param mv
- * the method visitor to which this adapter delegates calls.
+ * @param access access flags of the adapted method.
+ * @param method the adapted method.
+ * @param mv the method visitor to which this adapter delegates calls.
*/
- public GeneratorAdapter(final int access, final Method method,
- final MethodVisitor mv) {
+ public GeneratorAdapter(final int access, final Method method, final MethodVisitor mv) {
this(mv, access, null, method.getDescriptor());
}
/**
- * Creates a new {@link GeneratorAdapter}. Subclasses must not use this
- * constructor . Instead, they must use the
- * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
+ * Creates a new {@link GeneratorAdapter}. Subclasses must not use this constructor .
+ * Instead, they must use the {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
* version.
*
- * @param access
- * access flags of the adapted method.
- * @param method
- * the adapted method.
- * @param signature
- * the signature of the adapted method (may be null ).
- * @param exceptions
- * the exceptions thrown by the adapted method (may be
- * null ).
- * @param cv
- * the class visitor to which this adapter delegates calls.
+ * @param access access flags of the adapted method.
+ * @param method the adapted method.
+ * @param signature the signature of the adapted method (may be null ).
+ * @param exceptions the exceptions thrown by the adapted method (may be null ).
+ * @param cv the class visitor to which this adapter delegates calls.
*/
- public GeneratorAdapter(final int access, final Method method,
- final String signature, final Type[] exceptions,
- final ClassVisitor cv) {
- this(access, method, cv
- .visitMethod(access, method.getName(), method.getDescriptor(),
- signature, getInternalNames(exceptions)));
+ public GeneratorAdapter(final int access, final Method method, final String signature,
+ final Type[] exceptions, final ClassVisitor cv) {
+ this(access, method, cv.visitMethod(access, method.getName(), method.getDescriptor(),
+ signature, getInternalNames(exceptions)));
}
/**
* Returns the internal names of the given types.
*
- * @param types
- * a set of types.
+ * @param types a set of types.
* @return the internal names of the given types.
*/
private static String[] getInternalNames(final Type[] types) {
@@ -353,8 +306,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push the given value on the stack.
*
- * @param value
- * the value to be pushed on the stack.
+ * @param value the value to be pushed on the stack.
*/
public void push(final boolean value) {
push(value ? 1 : 0);
@@ -363,8 +315,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push the given value on the stack.
*
- * @param value
- * the value to be pushed on the stack.
+ * @param value the value to be pushed on the stack.
*/
public void push(final int value) {
if (value >= -1 && value <= 5) {
@@ -381,8 +332,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push the given value on the stack.
*
- * @param value
- * the value to be pushed on the stack.
+ * @param value the value to be pushed on the stack.
*/
public void push(final long value) {
if (value == 0L || value == 1L) {
@@ -395,8 +345,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push the given value on the stack.
*
- * @param value
- * the value to be pushed on the stack.
+ * @param value the value to be pushed on the stack.
*/
public void push(final float value) {
int bits = Float.floatToIntBits(value);
@@ -410,8 +359,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push the given value on the stack.
*
- * @param value
- * the value to be pushed on the stack.
+ * @param value the value to be pushed on the stack.
*/
public void push(final double value) {
long bits = Double.doubleToLongBits(value);
@@ -425,8 +373,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push the given value on the stack.
*
- * @param value
- * the value to be pushed on the stack. May be null .
+ * @param value the value to be pushed on the stack. May be null .
*/
public void push(final String value) {
if (value == null) {
@@ -439,48 +386,39 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push the given value on the stack.
*
- * @param value
- * the value to be pushed on the stack.
+ * @param value the value to be pushed on the stack.
*/
public void push(final Type value) {
if (value == null) {
mv.visitInsn(Opcodes.ACONST_NULL);
} else {
switch (value.getSort()) {
- case Type.BOOLEAN:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Boolean",
- "TYPE", CLDESC);
- break;
- case Type.CHAR:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Character",
- "TYPE", CLDESC);
- break;
- case Type.BYTE:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Byte", "TYPE",
- CLDESC);
- break;
- case Type.SHORT:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Short", "TYPE",
- CLDESC);
- break;
- case Type.INT:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Integer",
- "TYPE", CLDESC);
- break;
- case Type.FLOAT:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Float", "TYPE",
- CLDESC);
- break;
- case Type.LONG:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Long", "TYPE",
- CLDESC);
- break;
- case Type.DOUBLE:
- mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Double",
- "TYPE", CLDESC);
- break;
- default:
- mv.visitLdcInsn(value);
+ case Type.BOOLEAN:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Boolean", "TYPE", CLDESC);
+ break;
+ case Type.CHAR:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Character", "TYPE", CLDESC);
+ break;
+ case Type.BYTE:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Byte", "TYPE", CLDESC);
+ break;
+ case Type.SHORT:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Short", "TYPE", CLDESC);
+ break;
+ case Type.INT:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Integer", "TYPE", CLDESC);
+ break;
+ case Type.FLOAT:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Float", "TYPE", CLDESC);
+ break;
+ case Type.LONG:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Long", "TYPE", CLDESC);
+ break;
+ case Type.DOUBLE:
+ mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Double", "TYPE", CLDESC);
+ break;
+ default:
+ mv.visitLdcInsn(value);
}
}
}
@@ -488,8 +426,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push a handle on the stack.
*
- * @param handle
- * the handle to be pushed on the stack.
+ * @param handle the handle to be pushed on the stack.
*/
public void push(final Handle handle) {
mv.visitLdcInsn(handle);
@@ -500,13 +437,10 @@ public class GeneratorAdapter extends LocalVariablesSorter {
// ------------------------------------------------------------------------
/**
- * Returns the index of the given method argument in the frame's local
- * variables array.
+ * Returns the index of the given method argument in the frame's local variables array.
*
- * @param arg
- * the index of a method argument.
- * @return the index of the given method argument in the frame's local
- * variables array.
+ * @param arg the index of a method argument.
+ * @return the index of the given method argument in the frame's local variables array.
*/
private int getArgIndex(final int arg) {
int index = (access & Opcodes.ACC_STATIC) == 0 ? 1 : 0;
@@ -519,23 +453,18 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to push a local variable on the stack.
*
- * @param type
- * the type of the local variable to be loaded.
- * @param index
- * an index in the frame's local variables array.
+ * @param type the type of the local variable to be loaded.
+ * @param index an index in the frame's local variables array.
*/
private void loadInsn(final Type type, final int index) {
mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), index);
}
/**
- * Generates the instruction to store the top stack value in a local
- * variable.
+ * Generates the instruction to store the top stack value in a local variable.
*
- * @param type
- * the type of the local variable to be stored.
- * @param index
- * an index in the frame's local variables array.
+ * @param type the type of the local variable to be stored.
+ * @param index an index in the frame's local variables array.
*/
private void storeInsn(final Type type, final int index) {
mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), index);
@@ -546,8 +475,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
*/
public void loadThis() {
if ((access & Opcodes.ACC_STATIC) != 0) {
- throw new IllegalStateException(
- "no 'this' pointer within static method");
+ throw new IllegalStateException("no 'this' pointer within static method");
}
mv.visitVarInsn(Opcodes.ALOAD, 0);
}
@@ -555,21 +483,17 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to load the given method argument on the stack.
*
- * @param arg
- * the index of a method argument.
+ * @param arg the index of a method argument.
*/
public void loadArg(final int arg) {
loadInsn(argumentTypes[arg], getArgIndex(arg));
}
/**
- * Generates the instructions to load the given method arguments on the
- * stack.
+ * Generates the instructions to load the given method arguments on the stack.
*
- * @param arg
- * the index of the first method argument to be loaded.
- * @param count
- * the number of method arguments to be loaded.
+ * @param arg the index of the first method argument to be loaded.
+ * @param count the number of method arguments to be loaded.
*/
public void loadArgs(final int arg, final int count) {
int index = getArgIndex(arg);
@@ -588,8 +512,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Generates the instructions to load all the method arguments on the stack,
- * as a single object array.
+ * Generates the instructions to load all the method arguments on the stack, as a single object
+ * array.
*/
public void loadArgArray() {
push(argumentTypes.length);
@@ -604,11 +528,9 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Generates the instruction to store the top stack value in the given
- * method argument.
+ * Generates the instruction to store the top stack value in the given method argument.
*
- * @param arg
- * the index of a method argument.
+ * @param arg the index of a method argument.
*/
public void storeArg(final int arg) {
storeInsn(argumentTypes[arg], getArgIndex(arg));
@@ -621,9 +543,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Returns the type of the given local variable.
*
- * @param local
- * a local variable identifier, as returned by
- * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+ * @param local a local variable identifier, as returned by
+ * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
* @return the type of the given local variable.
*/
public Type getLocalType(final int local) {
@@ -642,9 +563,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to load the given local variable on the stack.
*
- * @param local
- * a local variable identifier, as returned by
- * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+ * @param local a local variable identifier, as returned by
+ * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
*/
public void loadLocal(final int local) {
loadInsn(getLocalType(local), local);
@@ -653,11 +573,9 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to load the given local variable on the stack.
*
- * @param local
- * a local variable identifier, as returned by
- * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
- * @param type
- * the type of this local variable.
+ * @param local a local variable identifier, as returned by
+ * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+ * @param type the type of this local variable.
*/
public void loadLocal(final int local, final Type type) {
setLocalType(local, type);
@@ -665,26 +583,21 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Generates the instruction to store the top stack value in the given local
- * variable.
+ * Generates the instruction to store the top stack value in the given local variable.
*
- * @param local
- * a local variable identifier, as returned by
- * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+ * @param local a local variable identifier, as returned by
+ * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
*/
public void storeLocal(final int local) {
storeInsn(getLocalType(local), local);
}
/**
- * Generates the instruction to store the top stack value in the given local
- * variable.
+ * Generates the instruction to store the top stack value in the given local variable.
*
- * @param local
- * a local variable identifier, as returned by
- * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
- * @param type
- * the type of this local variable.
+ * @param local a local variable identifier, as returned by
+ * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+ * @param type the type of this local variable.
*/
public void storeLocal(final int local, final Type type) {
setLocalType(local, type);
@@ -694,8 +607,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to load an element from an array.
*
- * @param type
- * the type of the array element to be loaded.
+ * @param type the type of the array element to be loaded.
*/
public void arrayLoad(final Type type) {
mv.visitInsn(type.getOpcode(Opcodes.IALOAD));
@@ -704,8 +616,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to store an element in an array.
*
- * @param type
- * the type of the array element to be stored.
+ * @param type the type of the array element to be stored.
*/
public void arrayStore(final Type type) {
mv.visitInsn(type.getOpcode(Opcodes.IASTORE));
@@ -781,10 +692,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instructions to swap the top two stack values.
*
- * @param prev
- * type of the top - 1 stack value.
- * @param type
- * type of the top stack value.
+ * @param prev type of the top - 1 stack value.
+ * @param type type of the top stack value.
*/
public void swap(final Type prev, final Type type) {
if (type.getSize() == 1) {
@@ -810,22 +719,18 @@ public class GeneratorAdapter extends LocalVariablesSorter {
// ------------------------------------------------------------------------
/**
- * Generates the instruction to do the specified mathematical or logical
- * operation.
+ * Generates the instruction to do the specified mathematical or logical operation.
*
- * @param op
- * a mathematical or logical operation. Must be one of ADD, SUB,
- * MUL, DIV, REM, NEG, SHL, SHR, USHR, AND, OR, XOR.
- * @param type
- * the type of the operand(s) for this operation.
+ * @param op a mathematical or logical operation. Must be one of ADD, SUB, MUL, DIV, REM, NEG,
+ * SHL, SHR, USHR, AND, OR, XOR.
+ * @param type the type of the operand(s) for this operation.
*/
public void math(final int op, final Type type) {
mv.visitInsn(type.getOpcode(op));
}
/**
- * Generates the instructions to compute the bitwise negation of the top
- * stack value.
+ * Generates the instructions to compute the bitwise negation of the top stack value.
*/
public void not() {
mv.visitInsn(Opcodes.ICONST_1);
@@ -835,23 +740,18 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to increment the given local variable.
*
- * @param local
- * the local variable to be incremented.
- * @param amount
- * the amount by which the local variable must be incremented.
+ * @param local the local variable to be incremented.
+ * @param amount the amount by which the local variable must be incremented.
*/
public void iinc(final int local, final int amount) {
mv.visitIincInsn(local, amount);
}
/**
- * Generates the instructions to cast a numerical value from one type to
- * another.
+ * Generates the instructions to cast a numerical value from one type to another.
*
- * @param from
- * the type of the top stack value
- * @param to
- * the type into which this value must be cast.
+ * @param from the type of the top stack value
+ * @param to the type into which this value must be cast.
*/
public void cast(final Type from, final Type to) {
if (from != to) {
@@ -906,32 +806,31 @@ public class GeneratorAdapter extends LocalVariablesSorter {
private static Type getBoxedType(final Type type) {
switch (type.getSort()) {
- case Type.BYTE:
- return BYTE_TYPE;
- case Type.BOOLEAN:
- return BOOLEAN_TYPE;
- case Type.SHORT:
- return SHORT_TYPE;
- case Type.CHAR:
- return CHARACTER_TYPE;
- case Type.INT:
- return INTEGER_TYPE;
- case Type.FLOAT:
- return FLOAT_TYPE;
- case Type.LONG:
- return LONG_TYPE;
- case Type.DOUBLE:
- return DOUBLE_TYPE;
+ case Type.BYTE:
+ return BYTE_TYPE;
+ case Type.BOOLEAN:
+ return BOOLEAN_TYPE;
+ case Type.SHORT:
+ return SHORT_TYPE;
+ case Type.CHAR:
+ return CHARACTER_TYPE;
+ case Type.INT:
+ return INTEGER_TYPE;
+ case Type.FLOAT:
+ return FLOAT_TYPE;
+ case Type.LONG:
+ return LONG_TYPE;
+ case Type.DOUBLE:
+ return DOUBLE_TYPE;
}
return type;
}
/**
- * Generates the instructions to box the top stack value. This value is
- * replaced by its boxed equivalent on top of the stack.
+ * Generates the instructions to box the top stack value. This value is replaced by its boxed
+ * equivalent on top of the stack.
*
- * @param type
- * the type of the top stack value.
+ * @param type the type of the top stack value.
*/
public void box(final Type type) {
if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
@@ -952,18 +851,15 @@ public class GeneratorAdapter extends LocalVariablesSorter {
dupX1();
swap();
}
- invokeConstructor(boxed, new Method("", Type.VOID_TYPE,
- new Type[] { type }));
+ invokeConstructor(boxed, new Method("", Type.VOID_TYPE, new Type[] {type}));
}
}
/**
- * Generates the instructions to box the top stack value using Java 5's
- * valueOf() method. This value is replaced by its boxed equivalent on top
- * of the stack.
+ * Generates the instructions to box the top stack value using Java 5's valueOf() method. This
+ * value is replaced by its boxed equivalent on top of the stack.
*
- * @param type
- * the type of the top stack value.
+ * @param type the type of the top stack value.
*/
public void valueOf(final Type type) {
if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
@@ -973,45 +869,43 @@ public class GeneratorAdapter extends LocalVariablesSorter {
push((String) null);
} else {
Type boxed = getBoxedType(type);
- invokeStatic(boxed, new Method("valueOf", boxed,
- new Type[] { type }));
+ invokeStatic(boxed, new Method("valueOf", boxed, new Type[] {type}));
}
}
/**
- * Generates the instructions to unbox the top stack value. This value is
- * replaced by its unboxed equivalent on top of the stack.
+ * Generates the instructions to unbox the top stack value. This value is replaced by its
+ * unboxed equivalent on top of the stack.
*
- * @param type
- * the type of the top stack value.
+ * @param type the type of the top stack value.
*/
public void unbox(final Type type) {
Type t = NUMBER_TYPE;
Method sig = null;
switch (type.getSort()) {
- case Type.VOID:
- return;
- case Type.CHAR:
- t = CHARACTER_TYPE;
- sig = CHAR_VALUE;
- break;
- case Type.BOOLEAN:
- t = BOOLEAN_TYPE;
- sig = BOOLEAN_VALUE;
- break;
- case Type.DOUBLE:
- sig = DOUBLE_VALUE;
- break;
- case Type.FLOAT:
- sig = FLOAT_VALUE;
- break;
- case Type.LONG:
- sig = LONG_VALUE;
- break;
- case Type.INT:
- case Type.SHORT:
- case Type.BYTE:
- sig = INT_VALUE;
+ case Type.VOID:
+ return;
+ case Type.CHAR:
+ t = CHARACTER_TYPE;
+ sig = CHAR_VALUE;
+ break;
+ case Type.BOOLEAN:
+ t = BOOLEAN_TYPE;
+ sig = BOOLEAN_VALUE;
+ break;
+ case Type.DOUBLE:
+ sig = DOUBLE_VALUE;
+ break;
+ case Type.FLOAT:
+ sig = FLOAT_VALUE;
+ break;
+ case Type.LONG:
+ sig = LONG_VALUE;
+ break;
+ case Type.INT:
+ case Type.SHORT:
+ case Type.BYTE:
+ sig = INT_VALUE;
}
if (sig == null) {
checkCast(type);
@@ -1037,8 +931,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Marks the current code position with the given label.
*
- * @param label
- * a label.
+ * @param label a label.
*/
public void mark(final Label label) {
mv.visitLabel(label);
@@ -1056,115 +949,98 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Generates the instructions to jump to a label based on the comparison of
- * the top two stack values.
+ * Generates the instructions to jump to a label based on the comparison of the top two stack
+ * values.
*
- * @param type
- * the type of the top two stack values.
- * @param mode
- * how these values must be compared. One of EQ, NE, LT, GE, GT,
- * LE.
- * @param label
- * where to jump if the comparison result is true .
+ * @param type the type of the top two stack values.
+ * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT, LE.
+ * @param label where to jump if the comparison result is true .
*/
public void ifCmp(final Type type, final int mode, final Label label) {
switch (type.getSort()) {
- case Type.LONG:
- mv.visitInsn(Opcodes.LCMP);
- break;
- case Type.DOUBLE:
- mv.visitInsn(mode == GE || mode == GT ? Opcodes.DCMPL
- : Opcodes.DCMPG);
- break;
- case Type.FLOAT:
- mv.visitInsn(mode == GE || mode == GT ? Opcodes.FCMPL
- : Opcodes.FCMPG);
- break;
- case Type.ARRAY:
- case Type.OBJECT:
- switch (mode) {
- case EQ:
- mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
+ case Type.LONG:
+ mv.visitInsn(Opcodes.LCMP);
+ break;
+ case Type.DOUBLE:
+ mv.visitInsn(mode == GE || mode == GT ? Opcodes.DCMPL : Opcodes.DCMPG);
+ break;
+ case Type.FLOAT:
+ mv.visitInsn(mode == GE || mode == GT ? Opcodes.FCMPL : Opcodes.FCMPG);
+ break;
+ case Type.ARRAY:
+ case Type.OBJECT:
+ switch (mode) {
+ case EQ:
+ mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
+ return;
+ case NE:
+ mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
+ return;
+ }
+ throw new IllegalArgumentException("Bad comparison for type " + type);
+ default:
+ int intOp = -1;
+ switch (mode) {
+ case EQ:
+ intOp = Opcodes.IF_ICMPEQ;
+ break;
+ case NE:
+ intOp = Opcodes.IF_ICMPNE;
+ break;
+ case GE:
+ intOp = Opcodes.IF_ICMPGE;
+ break;
+ case LT:
+ intOp = Opcodes.IF_ICMPLT;
+ break;
+ case LE:
+ intOp = Opcodes.IF_ICMPLE;
+ break;
+ case GT:
+ intOp = Opcodes.IF_ICMPGT;
+ break;
+ }
+ mv.visitJumpInsn(intOp, label);
return;
- case NE:
- mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
- return;
- }
- throw new IllegalArgumentException("Bad comparison for type "
- + type);
- default:
- int intOp = -1;
- switch (mode) {
- case EQ:
- intOp = Opcodes.IF_ICMPEQ;
- break;
- case NE:
- intOp = Opcodes.IF_ICMPNE;
- break;
- case GE:
- intOp = Opcodes.IF_ICMPGE;
- break;
- case LT:
- intOp = Opcodes.IF_ICMPLT;
- break;
- case LE:
- intOp = Opcodes.IF_ICMPLE;
- break;
- case GT:
- intOp = Opcodes.IF_ICMPGT;
- break;
- }
- mv.visitJumpInsn(intOp, label);
- return;
}
mv.visitJumpInsn(mode, label);
}
/**
- * Generates the instructions to jump to a label based on the comparison of
- * the top two integer stack values.
+ * Generates the instructions to jump to a label based on the comparison of the top two integer
+ * stack values.
*
- * @param mode
- * how these values must be compared. One of EQ, NE, LT, GE, GT,
- * LE.
- * @param label
- * where to jump if the comparison result is true .
+ * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT, LE.
+ * @param label where to jump if the comparison result is true .
*/
public void ifICmp(final int mode, final Label label) {
ifCmp(Type.INT_TYPE, mode, label);
}
/**
- * Generates the instructions to jump to a label based on the comparison of
- * the top integer stack value with zero.
+ * Generates the instructions to jump to a label based on the comparison of the top integer
+ * stack value with zero.
*
- * @param mode
- * how these values must be compared. One of EQ, NE, LT, GE, GT,
- * LE.
- * @param label
- * where to jump if the comparison result is true .
+ * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT, LE.
+ * @param label where to jump if the comparison result is true .
*/
public void ifZCmp(final int mode, final Label label) {
mv.visitJumpInsn(mode, label);
}
/**
- * Generates the instruction to jump to the given label if the top stack
- * value is null.
+ * Generates the instruction to jump to the given label if the top stack value is null.
*
- * @param label
- * where to jump if the condition is true .
+ * @param label where to jump if the condition is true .
*/
public void ifNull(final Label label) {
mv.visitJumpInsn(Opcodes.IFNULL, label);
}
/**
- * Generates the instruction to jump to the given label if the top stack
- * value is not null.
+ * Generates the instruction to jump to the given label if the top stack value is not null.
*
- * @param label
- * where to jump if the condition is true .
+ * @param label where to jump if the condition is true .
*/
public void ifNonNull(final Label label) {
mv.visitJumpInsn(Opcodes.IFNONNULL, label);
@@ -1173,8 +1049,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to jump to the given label.
*
- * @param label
- * where to jump if the condition is true .
+ * @param label where to jump if the condition is true .
*/
public void goTo(final Label label) {
mv.visitJumpInsn(Opcodes.GOTO, label);
@@ -1183,9 +1058,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates a RET instruction.
*
- * @param local
- * a local variable identifier, as returned by
- * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+ * @param local a local variable identifier, as returned by
+ * {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
*/
public void ret(final int local) {
mv.visitVarInsn(Opcodes.RET, local);
@@ -1194,19 +1068,15 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instructions for a switch statement.
*
- * @param keys
- * the switch case keys.
- * @param generator
- * a generator to generate the code for the switch cases.
+ * @param keys the switch case keys.
+ * @param generator a generator to generate the code for the switch cases.
*/
- public void tableSwitch(final int[] keys,
- final TableSwitchGenerator generator) {
+ public void tableSwitch(final int[] keys, final TableSwitchGenerator generator) {
float density;
if (keys.length == 0) {
density = 0;
} else {
- density = (float) keys.length
- / (keys[keys.length - 1] - keys[0] + 1);
+ density = (float) keys.length / (keys[keys.length - 1] - keys[0] + 1);
}
tableSwitch(keys, generator, density >= 0.5f);
}
@@ -1214,20 +1084,16 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instructions for a switch statement.
*
- * @param keys
- * the switch case keys.
- * @param generator
- * a generator to generate the code for the switch cases.
- * @param useTable
- * true to use a TABLESWITCH instruction, or
- * false to use a LOOKUPSWITCH instruction.
+ * @param keys the switch case keys.
+ * @param generator a generator to generate the code for the switch cases.
+ * @param useTable true to use a TABLESWITCH instruction, or false to use a
+ * LOOKUPSWITCH instruction.
*/
- public void tableSwitch(final int[] keys,
- final TableSwitchGenerator generator, final boolean useTable) {
+ public void tableSwitch(final int[] keys, final TableSwitchGenerator generator,
+ final boolean useTable) {
for (int i = 1; i < keys.length; ++i) {
if (keys[i] < keys[i - 1]) {
- throw new IllegalArgumentException(
- "keys must be sorted ascending");
+ throw new IllegalArgumentException("keys must be sorted ascending");
}
}
Label def = newLabel();
@@ -1282,31 +1148,22 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates a get field or set field instruction.
*
- * @param opcode
- * the instruction's opcode.
- * @param ownerType
- * the class in which the field is defined.
- * @param name
- * the name of the field.
- * @param fieldType
- * the type of the field.
+ * @param opcode the instruction's opcode.
+ * @param ownerType the class in which the field is defined.
+ * @param name the name of the field.
+ * @param fieldType the type of the field.
*/
- private void fieldInsn(final int opcode, final Type ownerType,
- final String name, final Type fieldType) {
- mv.visitFieldInsn(opcode, ownerType.getInternalName(), name,
- fieldType.getDescriptor());
+ private void fieldInsn(final int opcode, final Type ownerType, final String name,
+ final Type fieldType) {
+ mv.visitFieldInsn(opcode, ownerType.getInternalName(), name, fieldType.getDescriptor());
}
/**
- * Generates the instruction to push the value of a static field on the
- * stack.
+ * Generates the instruction to push the value of a static field on the stack.
*
- * @param owner
- * the class in which the field is defined.
- * @param name
- * the name of the field.
- * @param type
- * the type of the field.
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
*/
public void getStatic(final Type owner, final String name, final Type type) {
fieldInsn(Opcodes.GETSTATIC, owner, name, type);
@@ -1315,42 +1172,31 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to store the top stack value in a static field.
*
- * @param owner
- * the class in which the field is defined.
- * @param name
- * the name of the field.
- * @param type
- * the type of the field.
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
*/
public void putStatic(final Type owner, final String name, final Type type) {
fieldInsn(Opcodes.PUTSTATIC, owner, name, type);
}
/**
- * Generates the instruction to push the value of a non static field on the
- * stack.
+ * Generates the instruction to push the value of a non static field on the stack.
*
- * @param owner
- * the class in which the field is defined.
- * @param name
- * the name of the field.
- * @param type
- * the type of the field.
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
*/
public void getField(final Type owner, final String name, final Type type) {
fieldInsn(Opcodes.GETFIELD, owner, name, type);
}
/**
- * Generates the instruction to store the top stack value in a non static
- * field.
+ * Generates the instruction to store the top stack value in a non static field.
*
- * @param owner
- * the class in which the field is defined.
- * @param name
- * the name of the field.
- * @param type
- * the type of the field.
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
*/
public void putField(final Type owner, final String name, final Type type) {
fieldInsn(Opcodes.PUTFIELD, owner, name, type);
@@ -1363,28 +1209,20 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates an invoke method instruction.
*
- * @param opcode
- * the instruction's opcode.
- * @param type
- * the class in which the method is defined.
- * @param method
- * the method to be invoked.
+ * @param opcode the instruction's opcode.
+ * @param type the class in which the method is defined.
+ * @param method the method to be invoked.
*/
- private void invokeInsn(final int opcode, final Type type,
- final Method method) {
- String owner = type.getSort() == Type.ARRAY ? type.getDescriptor()
- : type.getInternalName();
- mv.visitMethodInsn(opcode, owner, method.getName(),
- method.getDescriptor());
+ private void invokeInsn(final int opcode, final Type type, final Method method) {
+ String owner = type.getSort() == Type.ARRAY ? type.getDescriptor() : type.getInternalName();
+ mv.visitMethodInsn(opcode, owner, method.getName(), method.getDescriptor());
}
/**
* Generates the instruction to invoke a normal method.
*
- * @param owner
- * the class in which the method is defined.
- * @param method
- * the method to be invoked.
+ * @param owner the class in which the method is defined.
+ * @param method the method to be invoked.
*/
public void invokeVirtual(final Type owner, final Method method) {
invokeInsn(Opcodes.INVOKEVIRTUAL, owner, method);
@@ -1393,10 +1231,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to invoke a constructor.
*
- * @param type
- * the class in which the constructor is defined.
- * @param method
- * the constructor to be invoked.
+ * @param type the class in which the constructor is defined.
+ * @param method the constructor to be invoked.
*/
public void invokeConstructor(final Type type, final Method method) {
invokeInsn(Opcodes.INVOKESPECIAL, type, method);
@@ -1405,10 +1241,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to invoke a static method.
*
- * @param owner
- * the class in which the method is defined.
- * @param method
- * the method to be invoked.
+ * @param owner the class in which the method is defined.
+ * @param method the method to be invoked.
*/
public void invokeStatic(final Type owner, final Method method) {
invokeInsn(Opcodes.INVOKESTATIC, owner, method);
@@ -1417,10 +1251,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to invoke an interface method.
*
- * @param owner
- * the class in which the method is defined.
- * @param method
- * the method to be invoked.
+ * @param owner the class in which the method is defined.
+ * @param method the method to be invoked.
*/
public void invokeInterface(final Type owner, final Method method) {
invokeInsn(Opcodes.INVOKEINTERFACE, owner, method);
@@ -1429,21 +1261,15 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates an invokedynamic instruction.
*
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link 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 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.
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link 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 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 void invokeDynamic(String name, String desc, Handle bsm,
- Object... bsmArgs) {
+ public void invokeDynamic(String name, String desc, Handle bsm, Object... bsmArgs) {
mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
}
@@ -1454,10 +1280,8 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates a type dependent instruction.
*
- * @param opcode
- * the instruction's opcode.
- * @param type
- * the instruction's operand.
+ * @param opcode the instruction's opcode.
+ * @param type the instruction's operand.
*/
private void typeInsn(final int opcode, final Type type) {
mv.visitTypeInsn(opcode, type.getInternalName());
@@ -1466,8 +1290,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to create a new object.
*
- * @param type
- * the class of the object to be created.
+ * @param type the class of the object to be created.
*/
public void newInstance(final Type type) {
typeInsn(Opcodes.NEW, type);
@@ -1476,39 +1299,38 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Generates the instruction to create a new array.
*
- * @param type
- * the type of the array elements.
+ * @param type the type of the array elements.
*/
public void newArray(final Type type) {
int typ;
switch (type.getSort()) {
- case Type.BOOLEAN:
- typ = Opcodes.T_BOOLEAN;
- break;
- case Type.CHAR:
- typ = Opcodes.T_CHAR;
- break;
- case Type.BYTE:
- typ = Opcodes.T_BYTE;
- break;
- case Type.SHORT:
- typ = Opcodes.T_SHORT;
- break;
- case Type.INT:
- typ = Opcodes.T_INT;
- break;
- case Type.FLOAT:
- typ = Opcodes.T_FLOAT;
- break;
- case Type.LONG:
- typ = Opcodes.T_LONG;
- break;
- case Type.DOUBLE:
- typ = Opcodes.T_DOUBLE;
- break;
- default:
- typeInsn(Opcodes.ANEWARRAY, type);
- return;
+ case Type.BOOLEAN:
+ typ = Opcodes.T_BOOLEAN;
+ break;
+ case Type.CHAR:
+ typ = Opcodes.T_CHAR;
+ break;
+ case Type.BYTE:
+ typ = Opcodes.T_BYTE;
+ break;
+ case Type.SHORT:
+ typ = Opcodes.T_SHORT;
+ break;
+ case Type.INT:
+ typ = Opcodes.T_INT;
+ break;
+ case Type.FLOAT:
+ typ = Opcodes.T_FLOAT;
+ break;
+ case Type.LONG:
+ typ = Opcodes.T_LONG;
+ break;
+ case Type.DOUBLE:
+ typ = Opcodes.T_DOUBLE;
+ break;
+ default:
+ typeInsn(Opcodes.ANEWARRAY, type);
+ return;
}
mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
@@ -1532,13 +1354,11 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Generates the instructions to create and throw an exception. The
- * exception class must have a constructor with a single String argument.
+ * Generates the instructions to create and throw an exception. The exception class must have a
+ * constructor with a single String argument.
*
- * @param type
- * the class of the exception to be thrown.
- * @param msg
- * the detailed message of the exception.
+ * @param type the class of the exception to be thrown.
+ * @param msg the detailed message of the exception.
*/
public void throwException(final Type type, final String msg) {
newInstance(type);
@@ -1549,11 +1369,9 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Generates the instruction to check that the top stack value is of the
- * given type.
+ * Generates the instruction to check that the top stack value is of the given type.
*
- * @param type
- * a class or interface type.
+ * @param type a class or interface type.
*/
public void checkCast(final Type type) {
if (!type.equals(OBJECT_TYPE)) {
@@ -1562,11 +1380,9 @@ public class GeneratorAdapter extends LocalVariablesSorter {
}
/**
- * Generates the instruction to test if the top stack value is of the given
- * type.
+ * Generates the instruction to test if the top stack value is of the given type.
*
- * @param type
- * a class or interface type.
+ * @param type a class or interface type.
*/
public void instanceOf(final Type type) {
typeInsn(Opcodes.INSTANCEOF, type);
@@ -1603,21 +1419,15 @@ public class GeneratorAdapter extends LocalVariablesSorter {
/**
* Marks the start of an exception handler.
*
- * @param start
- * beginning of the exception handler's scope (inclusive).
- * @param end
- * end of the exception handler's scope (exclusive).
- * @param exception
- * internal name of the type of exceptions handled by the
- * handler.
+ * @param start beginning of the exception handler's scope (inclusive).
+ * @param end end of the exception handler's scope (exclusive).
+ * @param exception internal name of the type of exceptions handled by the handler.
*/
- public void catchException(final Label start, final Label end,
- final Type exception) {
+ public void catchException(final Label start, final Label end, final Type exception) {
if (exception == null) {
mv.visitTryCatchBlock(start, end, mark(), null);
} else {
- mv.visitTryCatchBlock(start, end, mark(),
- exception.getInternalName());
+ mv.visitTryCatchBlock(start, end, mark(), exception.getInternalName());
}
}
}
diff --git a/src/main/asm/org/objectweb/asm/commons/InstructionAdapter.java b/src/main/asm/org/objectweb/asm/commons/InstructionAdapter.java
index 1f4c5a5..612fc66 100644
--- a/src/main/asm/org/objectweb/asm/commons/InstructionAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/InstructionAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -37,8 +29,7 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
/**
- * A {@link MethodVisitor} providing a more detailed API to generate and
- * transform instructions.
+ * A {@link MethodVisitor} providing a more detailed API to generate and transform instructions.
*
* @author Eric Bruneton
*/
@@ -47,12 +38,10 @@ public class InstructionAdapter extends MethodVisitor {
public final static Type OBJECT_TYPE = Type.getType("Ljava/lang/Object;");
/**
- * Creates a new {@link InstructionAdapter}. Subclasses must not use this
- * constructor . Instead, they must use the
- * {@link #InstructionAdapter(int, MethodVisitor)} version.
+ * Creates a new {@link InstructionAdapter}. Subclasses must not use this constructor .
+ * Instead, they must use the {@link #InstructionAdapter(int, MethodVisitor)} version.
*
- * @param mv
- * the method visitor to which this adapter delegates calls.
+ * @param mv the method visitor to which this adapter delegates calls.
*/
public InstructionAdapter(final MethodVisitor mv) {
this(Opcodes.ASM4, mv);
@@ -61,11 +50,9 @@ public class InstructionAdapter extends MethodVisitor {
/**
* Creates a new {@link InstructionAdapter}.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param mv
- * the method visitor to which this adapter delegates calls.
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param mv the method visitor to which this adapter delegates calls.
*/
protected InstructionAdapter(final int api, final MethodVisitor mv) {
super(api, mv);
@@ -74,394 +61,394 @@ public class InstructionAdapter extends MethodVisitor {
@Override
public void visitInsn(final int opcode) {
switch (opcode) {
- case Opcodes.NOP:
- nop();
- break;
- case Opcodes.ACONST_NULL:
- aconst(null);
- break;
- case Opcodes.ICONST_M1:
- case Opcodes.ICONST_0:
- case Opcodes.ICONST_1:
- case Opcodes.ICONST_2:
- case Opcodes.ICONST_3:
- case Opcodes.ICONST_4:
- case Opcodes.ICONST_5:
- iconst(opcode - Opcodes.ICONST_0);
- break;
- case Opcodes.LCONST_0:
- case Opcodes.LCONST_1:
- lconst(opcode - Opcodes.LCONST_0);
- break;
- case Opcodes.FCONST_0:
- case Opcodes.FCONST_1:
- case Opcodes.FCONST_2:
- fconst(opcode - Opcodes.FCONST_0);
- break;
- case Opcodes.DCONST_0:
- case Opcodes.DCONST_1:
- dconst(opcode - Opcodes.DCONST_0);
- break;
- case Opcodes.IALOAD:
- aload(Type.INT_TYPE);
- break;
- case Opcodes.LALOAD:
- aload(Type.LONG_TYPE);
- break;
- case Opcodes.FALOAD:
- aload(Type.FLOAT_TYPE);
- break;
- case Opcodes.DALOAD:
- aload(Type.DOUBLE_TYPE);
- break;
- case Opcodes.AALOAD:
- aload(OBJECT_TYPE);
- break;
- case Opcodes.BALOAD:
- aload(Type.BYTE_TYPE);
- break;
- case Opcodes.CALOAD:
- aload(Type.CHAR_TYPE);
- break;
- case Opcodes.SALOAD:
- aload(Type.SHORT_TYPE);
- break;
- case Opcodes.IASTORE:
- astore(Type.INT_TYPE);
- break;
- case Opcodes.LASTORE:
- astore(Type.LONG_TYPE);
- break;
- case Opcodes.FASTORE:
- astore(Type.FLOAT_TYPE);
- break;
- case Opcodes.DASTORE:
- astore(Type.DOUBLE_TYPE);
- break;
- case Opcodes.AASTORE:
- astore(OBJECT_TYPE);
- break;
- case Opcodes.BASTORE:
- astore(Type.BYTE_TYPE);
- break;
- case Opcodes.CASTORE:
- astore(Type.CHAR_TYPE);
- break;
- case Opcodes.SASTORE:
- astore(Type.SHORT_TYPE);
- break;
- case Opcodes.POP:
- pop();
- break;
- case Opcodes.POP2:
- pop2();
- break;
- case Opcodes.DUP:
- dup();
- break;
- case Opcodes.DUP_X1:
- dupX1();
- break;
- case Opcodes.DUP_X2:
- dupX2();
- break;
- case Opcodes.DUP2:
- dup2();
- break;
- case Opcodes.DUP2_X1:
- dup2X1();
- break;
- case Opcodes.DUP2_X2:
- dup2X2();
- break;
- case Opcodes.SWAP:
- swap();
- break;
- case Opcodes.IADD:
- add(Type.INT_TYPE);
- break;
- case Opcodes.LADD:
- add(Type.LONG_TYPE);
- break;
- case Opcodes.FADD:
- add(Type.FLOAT_TYPE);
- break;
- case Opcodes.DADD:
- add(Type.DOUBLE_TYPE);
- break;
- case Opcodes.ISUB:
- sub(Type.INT_TYPE);
- break;
- case Opcodes.LSUB:
- sub(Type.LONG_TYPE);
- break;
- case Opcodes.FSUB:
- sub(Type.FLOAT_TYPE);
- break;
- case Opcodes.DSUB:
- sub(Type.DOUBLE_TYPE);
- break;
- case Opcodes.IMUL:
- mul(Type.INT_TYPE);
- break;
- case Opcodes.LMUL:
- mul(Type.LONG_TYPE);
- break;
- case Opcodes.FMUL:
- mul(Type.FLOAT_TYPE);
- break;
- case Opcodes.DMUL:
- mul(Type.DOUBLE_TYPE);
- break;
- case Opcodes.IDIV:
- div(Type.INT_TYPE);
- break;
- case Opcodes.LDIV:
- div(Type.LONG_TYPE);
- break;
- case Opcodes.FDIV:
- div(Type.FLOAT_TYPE);
- break;
- case Opcodes.DDIV:
- div(Type.DOUBLE_TYPE);
- break;
- case Opcodes.IREM:
- rem(Type.INT_TYPE);
- break;
- case Opcodes.LREM:
- rem(Type.LONG_TYPE);
- break;
- case Opcodes.FREM:
- rem(Type.FLOAT_TYPE);
- break;
- case Opcodes.DREM:
- rem(Type.DOUBLE_TYPE);
- break;
- case Opcodes.INEG:
- neg(Type.INT_TYPE);
- break;
- case Opcodes.LNEG:
- neg(Type.LONG_TYPE);
- break;
- case Opcodes.FNEG:
- neg(Type.FLOAT_TYPE);
- break;
- case Opcodes.DNEG:
- neg(Type.DOUBLE_TYPE);
- break;
- case Opcodes.ISHL:
- shl(Type.INT_TYPE);
- break;
- case Opcodes.LSHL:
- shl(Type.LONG_TYPE);
- break;
- case Opcodes.ISHR:
- shr(Type.INT_TYPE);
- break;
- case Opcodes.LSHR:
- shr(Type.LONG_TYPE);
- break;
- case Opcodes.IUSHR:
- ushr(Type.INT_TYPE);
- break;
- case Opcodes.LUSHR:
- ushr(Type.LONG_TYPE);
- break;
- case Opcodes.IAND:
- and(Type.INT_TYPE);
- break;
- case Opcodes.LAND:
- and(Type.LONG_TYPE);
- break;
- case Opcodes.IOR:
- or(Type.INT_TYPE);
- break;
- case Opcodes.LOR:
- or(Type.LONG_TYPE);
- break;
- case Opcodes.IXOR:
- xor(Type.INT_TYPE);
- break;
- case Opcodes.LXOR:
- xor(Type.LONG_TYPE);
- break;
- case Opcodes.I2L:
- cast(Type.INT_TYPE, Type.LONG_TYPE);
- break;
- case Opcodes.I2F:
- cast(Type.INT_TYPE, Type.FLOAT_TYPE);
- break;
- case Opcodes.I2D:
- cast(Type.INT_TYPE, Type.DOUBLE_TYPE);
- break;
- case Opcodes.L2I:
- cast(Type.LONG_TYPE, Type.INT_TYPE);
- break;
- case Opcodes.L2F:
- cast(Type.LONG_TYPE, Type.FLOAT_TYPE);
- break;
- case Opcodes.L2D:
- cast(Type.LONG_TYPE, Type.DOUBLE_TYPE);
- break;
- case Opcodes.F2I:
- cast(Type.FLOAT_TYPE, Type.INT_TYPE);
- break;
- case Opcodes.F2L:
- cast(Type.FLOAT_TYPE, Type.LONG_TYPE);
- break;
- case Opcodes.F2D:
- cast(Type.FLOAT_TYPE, Type.DOUBLE_TYPE);
- break;
- case Opcodes.D2I:
- cast(Type.DOUBLE_TYPE, Type.INT_TYPE);
- break;
- case Opcodes.D2L:
- cast(Type.DOUBLE_TYPE, Type.LONG_TYPE);
- break;
- case Opcodes.D2F:
- cast(Type.DOUBLE_TYPE, Type.FLOAT_TYPE);
- break;
- case Opcodes.I2B:
- cast(Type.INT_TYPE, Type.BYTE_TYPE);
- break;
- case Opcodes.I2C:
- cast(Type.INT_TYPE, Type.CHAR_TYPE);
- break;
- case Opcodes.I2S:
- cast(Type.INT_TYPE, Type.SHORT_TYPE);
- break;
- case Opcodes.LCMP:
- lcmp();
- break;
- case Opcodes.FCMPL:
- cmpl(Type.FLOAT_TYPE);
- break;
- case Opcodes.FCMPG:
- cmpg(Type.FLOAT_TYPE);
- break;
- case Opcodes.DCMPL:
- cmpl(Type.DOUBLE_TYPE);
- break;
- case Opcodes.DCMPG:
- cmpg(Type.DOUBLE_TYPE);
- break;
- case Opcodes.IRETURN:
- areturn(Type.INT_TYPE);
- break;
- case Opcodes.LRETURN:
- areturn(Type.LONG_TYPE);
- break;
- case Opcodes.FRETURN:
- areturn(Type.FLOAT_TYPE);
- break;
- case Opcodes.DRETURN:
- areturn(Type.DOUBLE_TYPE);
- break;
- case Opcodes.ARETURN:
- areturn(OBJECT_TYPE);
- break;
- case Opcodes.RETURN:
- areturn(Type.VOID_TYPE);
- break;
- case Opcodes.ARRAYLENGTH:
- arraylength();
- break;
- case Opcodes.ATHROW:
- athrow();
- break;
- case Opcodes.MONITORENTER:
- monitorenter();
- break;
- case Opcodes.MONITOREXIT:
- monitorexit();
- break;
- default:
- throw new IllegalArgumentException();
+ case Opcodes.NOP:
+ nop();
+ break;
+ case Opcodes.ACONST_NULL:
+ aconst(null);
+ break;
+ case Opcodes.ICONST_M1:
+ case Opcodes.ICONST_0:
+ case Opcodes.ICONST_1:
+ case Opcodes.ICONST_2:
+ case Opcodes.ICONST_3:
+ case Opcodes.ICONST_4:
+ case Opcodes.ICONST_5:
+ iconst(opcode - Opcodes.ICONST_0);
+ break;
+ case Opcodes.LCONST_0:
+ case Opcodes.LCONST_1:
+ lconst(opcode - Opcodes.LCONST_0);
+ break;
+ case Opcodes.FCONST_0:
+ case Opcodes.FCONST_1:
+ case Opcodes.FCONST_2:
+ fconst(opcode - Opcodes.FCONST_0);
+ break;
+ case Opcodes.DCONST_0:
+ case Opcodes.DCONST_1:
+ dconst(opcode - Opcodes.DCONST_0);
+ break;
+ case Opcodes.IALOAD:
+ aload(Type.INT_TYPE);
+ break;
+ case Opcodes.LALOAD:
+ aload(Type.LONG_TYPE);
+ break;
+ case Opcodes.FALOAD:
+ aload(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DALOAD:
+ aload(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.AALOAD:
+ aload(OBJECT_TYPE);
+ break;
+ case Opcodes.BALOAD:
+ aload(Type.BYTE_TYPE);
+ break;
+ case Opcodes.CALOAD:
+ aload(Type.CHAR_TYPE);
+ break;
+ case Opcodes.SALOAD:
+ aload(Type.SHORT_TYPE);
+ break;
+ case Opcodes.IASTORE:
+ astore(Type.INT_TYPE);
+ break;
+ case Opcodes.LASTORE:
+ astore(Type.LONG_TYPE);
+ break;
+ case Opcodes.FASTORE:
+ astore(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DASTORE:
+ astore(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.AASTORE:
+ astore(OBJECT_TYPE);
+ break;
+ case Opcodes.BASTORE:
+ astore(Type.BYTE_TYPE);
+ break;
+ case Opcodes.CASTORE:
+ astore(Type.CHAR_TYPE);
+ break;
+ case Opcodes.SASTORE:
+ astore(Type.SHORT_TYPE);
+ break;
+ case Opcodes.POP:
+ pop();
+ break;
+ case Opcodes.POP2:
+ pop2();
+ break;
+ case Opcodes.DUP:
+ dup();
+ break;
+ case Opcodes.DUP_X1:
+ dupX1();
+ break;
+ case Opcodes.DUP_X2:
+ dupX2();
+ break;
+ case Opcodes.DUP2:
+ dup2();
+ break;
+ case Opcodes.DUP2_X1:
+ dup2X1();
+ break;
+ case Opcodes.DUP2_X2:
+ dup2X2();
+ break;
+ case Opcodes.SWAP:
+ swap();
+ break;
+ case Opcodes.IADD:
+ add(Type.INT_TYPE);
+ break;
+ case Opcodes.LADD:
+ add(Type.LONG_TYPE);
+ break;
+ case Opcodes.FADD:
+ add(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DADD:
+ add(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.ISUB:
+ sub(Type.INT_TYPE);
+ break;
+ case Opcodes.LSUB:
+ sub(Type.LONG_TYPE);
+ break;
+ case Opcodes.FSUB:
+ sub(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DSUB:
+ sub(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.IMUL:
+ mul(Type.INT_TYPE);
+ break;
+ case Opcodes.LMUL:
+ mul(Type.LONG_TYPE);
+ break;
+ case Opcodes.FMUL:
+ mul(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DMUL:
+ mul(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.IDIV:
+ div(Type.INT_TYPE);
+ break;
+ case Opcodes.LDIV:
+ div(Type.LONG_TYPE);
+ break;
+ case Opcodes.FDIV:
+ div(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DDIV:
+ div(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.IREM:
+ rem(Type.INT_TYPE);
+ break;
+ case Opcodes.LREM:
+ rem(Type.LONG_TYPE);
+ break;
+ case Opcodes.FREM:
+ rem(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DREM:
+ rem(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.INEG:
+ neg(Type.INT_TYPE);
+ break;
+ case Opcodes.LNEG:
+ neg(Type.LONG_TYPE);
+ break;
+ case Opcodes.FNEG:
+ neg(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DNEG:
+ neg(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.ISHL:
+ shl(Type.INT_TYPE);
+ break;
+ case Opcodes.LSHL:
+ shl(Type.LONG_TYPE);
+ break;
+ case Opcodes.ISHR:
+ shr(Type.INT_TYPE);
+ break;
+ case Opcodes.LSHR:
+ shr(Type.LONG_TYPE);
+ break;
+ case Opcodes.IUSHR:
+ ushr(Type.INT_TYPE);
+ break;
+ case Opcodes.LUSHR:
+ ushr(Type.LONG_TYPE);
+ break;
+ case Opcodes.IAND:
+ and(Type.INT_TYPE);
+ break;
+ case Opcodes.LAND:
+ and(Type.LONG_TYPE);
+ break;
+ case Opcodes.IOR:
+ or(Type.INT_TYPE);
+ break;
+ case Opcodes.LOR:
+ or(Type.LONG_TYPE);
+ break;
+ case Opcodes.IXOR:
+ xor(Type.INT_TYPE);
+ break;
+ case Opcodes.LXOR:
+ xor(Type.LONG_TYPE);
+ break;
+ case Opcodes.I2L:
+ cast(Type.INT_TYPE, Type.LONG_TYPE);
+ break;
+ case Opcodes.I2F:
+ cast(Type.INT_TYPE, Type.FLOAT_TYPE);
+ break;
+ case Opcodes.I2D:
+ cast(Type.INT_TYPE, Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.L2I:
+ cast(Type.LONG_TYPE, Type.INT_TYPE);
+ break;
+ case Opcodes.L2F:
+ cast(Type.LONG_TYPE, Type.FLOAT_TYPE);
+ break;
+ case Opcodes.L2D:
+ cast(Type.LONG_TYPE, Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.F2I:
+ cast(Type.FLOAT_TYPE, Type.INT_TYPE);
+ break;
+ case Opcodes.F2L:
+ cast(Type.FLOAT_TYPE, Type.LONG_TYPE);
+ break;
+ case Opcodes.F2D:
+ cast(Type.FLOAT_TYPE, Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.D2I:
+ cast(Type.DOUBLE_TYPE, Type.INT_TYPE);
+ break;
+ case Opcodes.D2L:
+ cast(Type.DOUBLE_TYPE, Type.LONG_TYPE);
+ break;
+ case Opcodes.D2F:
+ cast(Type.DOUBLE_TYPE, Type.FLOAT_TYPE);
+ break;
+ case Opcodes.I2B:
+ cast(Type.INT_TYPE, Type.BYTE_TYPE);
+ break;
+ case Opcodes.I2C:
+ cast(Type.INT_TYPE, Type.CHAR_TYPE);
+ break;
+ case Opcodes.I2S:
+ cast(Type.INT_TYPE, Type.SHORT_TYPE);
+ break;
+ case Opcodes.LCMP:
+ lcmp();
+ break;
+ case Opcodes.FCMPL:
+ cmpl(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.FCMPG:
+ cmpg(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DCMPL:
+ cmpl(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.DCMPG:
+ cmpg(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.IRETURN:
+ areturn(Type.INT_TYPE);
+ break;
+ case Opcodes.LRETURN:
+ areturn(Type.LONG_TYPE);
+ break;
+ case Opcodes.FRETURN:
+ areturn(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DRETURN:
+ areturn(Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.ARETURN:
+ areturn(OBJECT_TYPE);
+ break;
+ case Opcodes.RETURN:
+ areturn(Type.VOID_TYPE);
+ break;
+ case Opcodes.ARRAYLENGTH:
+ arraylength();
+ break;
+ case Opcodes.ATHROW:
+ athrow();
+ break;
+ case Opcodes.MONITORENTER:
+ monitorenter();
+ break;
+ case Opcodes.MONITOREXIT:
+ monitorexit();
+ break;
+ default:
+ throw new IllegalArgumentException();
}
}
@Override
public void visitIntInsn(final int opcode, final int operand) {
switch (opcode) {
- case Opcodes.BIPUSH:
- iconst(operand);
- break;
- case Opcodes.SIPUSH:
- iconst(operand);
- break;
- case Opcodes.NEWARRAY:
- switch (operand) {
- case Opcodes.T_BOOLEAN:
- newarray(Type.BOOLEAN_TYPE);
+ case Opcodes.BIPUSH:
+ iconst(operand);
break;
- case Opcodes.T_CHAR:
- newarray(Type.CHAR_TYPE);
+ case Opcodes.SIPUSH:
+ iconst(operand);
break;
- case Opcodes.T_BYTE:
- newarray(Type.BYTE_TYPE);
- break;
- case Opcodes.T_SHORT:
- newarray(Type.SHORT_TYPE);
- break;
- case Opcodes.T_INT:
- newarray(Type.INT_TYPE);
- break;
- case Opcodes.T_FLOAT:
- newarray(Type.FLOAT_TYPE);
- break;
- case Opcodes.T_LONG:
- newarray(Type.LONG_TYPE);
- break;
- case Opcodes.T_DOUBLE:
- newarray(Type.DOUBLE_TYPE);
+ case Opcodes.NEWARRAY:
+ switch (operand) {
+ case Opcodes.T_BOOLEAN:
+ newarray(Type.BOOLEAN_TYPE);
+ break;
+ case Opcodes.T_CHAR:
+ newarray(Type.CHAR_TYPE);
+ break;
+ case Opcodes.T_BYTE:
+ newarray(Type.BYTE_TYPE);
+ break;
+ case Opcodes.T_SHORT:
+ newarray(Type.SHORT_TYPE);
+ break;
+ case Opcodes.T_INT:
+ newarray(Type.INT_TYPE);
+ break;
+ case Opcodes.T_FLOAT:
+ newarray(Type.FLOAT_TYPE);
+ break;
+ case Opcodes.T_LONG:
+ newarray(Type.LONG_TYPE);
+ break;
+ case Opcodes.T_DOUBLE:
+ newarray(Type.DOUBLE_TYPE);
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
break;
default:
throw new IllegalArgumentException();
- }
- break;
- default:
- throw new IllegalArgumentException();
}
}
@Override
public void visitVarInsn(final int opcode, final int var) {
switch (opcode) {
- case Opcodes.ILOAD:
- load(var, Type.INT_TYPE);
- break;
- case Opcodes.LLOAD:
- load(var, Type.LONG_TYPE);
- break;
- case Opcodes.FLOAD:
- load(var, Type.FLOAT_TYPE);
- break;
- case Opcodes.DLOAD:
- load(var, Type.DOUBLE_TYPE);
- break;
- case Opcodes.ALOAD:
- load(var, OBJECT_TYPE);
- break;
- case Opcodes.ISTORE:
- store(var, Type.INT_TYPE);
- break;
- case Opcodes.LSTORE:
- store(var, Type.LONG_TYPE);
- break;
- case Opcodes.FSTORE:
- store(var, Type.FLOAT_TYPE);
- break;
- case Opcodes.DSTORE:
- store(var, Type.DOUBLE_TYPE);
- break;
- case Opcodes.ASTORE:
- store(var, OBJECT_TYPE);
- break;
- case Opcodes.RET:
- ret(var);
- break;
- default:
- throw new IllegalArgumentException();
+ case Opcodes.ILOAD:
+ load(var, Type.INT_TYPE);
+ break;
+ case Opcodes.LLOAD:
+ load(var, Type.LONG_TYPE);
+ break;
+ case Opcodes.FLOAD:
+ load(var, Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DLOAD:
+ load(var, Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.ALOAD:
+ load(var, OBJECT_TYPE);
+ break;
+ case Opcodes.ISTORE:
+ store(var, Type.INT_TYPE);
+ break;
+ case Opcodes.LSTORE:
+ store(var, Type.LONG_TYPE);
+ break;
+ case Opcodes.FSTORE:
+ store(var, Type.FLOAT_TYPE);
+ break;
+ case Opcodes.DSTORE:
+ store(var, Type.DOUBLE_TYPE);
+ break;
+ case Opcodes.ASTORE:
+ store(var, OBJECT_TYPE);
+ break;
+ case Opcodes.RET:
+ ret(var);
+ break;
+ default:
+ throw new IllegalArgumentException();
}
}
@@ -469,130 +456,129 @@ public class InstructionAdapter extends MethodVisitor {
public void visitTypeInsn(final int opcode, final String type) {
Type t = Type.getObjectType(type);
switch (opcode) {
- case Opcodes.NEW:
- anew(t);
- break;
- case Opcodes.ANEWARRAY:
- newarray(t);
- break;
- case Opcodes.CHECKCAST:
- checkcast(t);
- break;
- case Opcodes.INSTANCEOF:
- instanceOf(t);
- break;
- default:
- throw new IllegalArgumentException();
+ case Opcodes.NEW:
+ anew(t);
+ break;
+ case Opcodes.ANEWARRAY:
+ newarray(t);
+ break;
+ case Opcodes.CHECKCAST:
+ checkcast(t);
+ break;
+ case Opcodes.INSTANCEOF:
+ instanceOf(t);
+ break;
+ default:
+ throw new IllegalArgumentException();
}
}
@Override
- public void visitFieldInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitFieldInsn(final int opcode, final String owner, final String name,
+ final String desc) {
switch (opcode) {
- case Opcodes.GETSTATIC:
- getstatic(owner, name, desc);
- break;
- case Opcodes.PUTSTATIC:
- putstatic(owner, name, desc);
- break;
- case Opcodes.GETFIELD:
- getfield(owner, name, desc);
- break;
- case Opcodes.PUTFIELD:
- putfield(owner, name, desc);
- break;
- default:
- throw new IllegalArgumentException();
+ case Opcodes.GETSTATIC:
+ getstatic(owner, name, desc);
+ break;
+ case Opcodes.PUTSTATIC:
+ putstatic(owner, name, desc);
+ break;
+ case Opcodes.GETFIELD:
+ getfield(owner, name, desc);
+ break;
+ case Opcodes.PUTFIELD:
+ putfield(owner, name, desc);
+ break;
+ default:
+ throw new IllegalArgumentException();
}
}
@Override
- public void visitMethodInsn(final int opcode, final String owner,
- final String name, final String desc) {
+ public void visitMethodInsn(final int opcode, final String owner, final String name,
+ final String desc) {
switch (opcode) {
- case Opcodes.INVOKESPECIAL:
- invokespecial(owner, name, desc);
- break;
- case Opcodes.INVOKEVIRTUAL:
- invokevirtual(owner, name, desc);
- break;
- case Opcodes.INVOKESTATIC:
- invokestatic(owner, name, desc);
- break;
- case Opcodes.INVOKEINTERFACE:
- invokeinterface(owner, name, desc);
- break;
- default:
- throw new IllegalArgumentException();
+ case Opcodes.INVOKESPECIAL:
+ invokespecial(owner, name, desc);
+ break;
+ case Opcodes.INVOKEVIRTUAL:
+ invokevirtual(owner, name, desc);
+ break;
+ case Opcodes.INVOKESTATIC:
+ invokestatic(owner, name, desc);
+ break;
+ case Opcodes.INVOKEINTERFACE:
+ invokeinterface(owner, name, desc);
+ break;
+ default:
+ throw new IllegalArgumentException();
}
}
@Override
- public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
- Object... bsmArgs) {
+ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
invokedynamic(name, desc, bsm, bsmArgs);
}
@Override
public void visitJumpInsn(final int opcode, final Label label) {
switch (opcode) {
- case Opcodes.IFEQ:
- ifeq(label);
- break;
- case Opcodes.IFNE:
- ifne(label);
- break;
- case Opcodes.IFLT:
- iflt(label);
- break;
- case Opcodes.IFGE:
- ifge(label);
- break;
- case Opcodes.IFGT:
- ifgt(label);
- break;
- case Opcodes.IFLE:
- ifle(label);
- break;
- case Opcodes.IF_ICMPEQ:
- ificmpeq(label);
- break;
- case Opcodes.IF_ICMPNE:
- ificmpne(label);
- break;
- case Opcodes.IF_ICMPLT:
- ificmplt(label);
- break;
- case Opcodes.IF_ICMPGE:
- ificmpge(label);
- break;
- case Opcodes.IF_ICMPGT:
- ificmpgt(label);
- break;
- case Opcodes.IF_ICMPLE:
- ificmple(label);
- break;
- case Opcodes.IF_ACMPEQ:
- ifacmpeq(label);
- break;
- case Opcodes.IF_ACMPNE:
- ifacmpne(label);
- break;
- case Opcodes.GOTO:
- goTo(label);
- break;
- case Opcodes.JSR:
- jsr(label);
- break;
- case Opcodes.IFNULL:
- ifnull(label);
- break;
- case Opcodes.IFNONNULL:
- ifnonnull(label);
- break;
- default:
- throw new IllegalArgumentException();
+ case Opcodes.IFEQ:
+ ifeq(label);
+ break;
+ case Opcodes.IFNE:
+ ifne(label);
+ break;
+ case Opcodes.IFLT:
+ iflt(label);
+ break;
+ case Opcodes.IFGE:
+ ifge(label);
+ break;
+ case Opcodes.IFGT:
+ ifgt(label);
+ break;
+ case Opcodes.IFLE:
+ ifle(label);
+ break;
+ case Opcodes.IF_ICMPEQ:
+ ificmpeq(label);
+ break;
+ case Opcodes.IF_ICMPNE:
+ ificmpne(label);
+ break;
+ case Opcodes.IF_ICMPLT:
+ ificmplt(label);
+ break;
+ case Opcodes.IF_ICMPGE:
+ ificmpge(label);
+ break;
+ case Opcodes.IF_ICMPGT:
+ ificmpgt(label);
+ break;
+ case Opcodes.IF_ICMPLE:
+ ificmple(label);
+ break;
+ case Opcodes.IF_ACMPEQ:
+ ifacmpeq(label);
+ break;
+ case Opcodes.IF_ACMPNE:
+ ifacmpne(label);
+ break;
+ case Opcodes.GOTO:
+ goTo(label);
+ break;
+ case Opcodes.JSR:
+ jsr(label);
+ break;
+ case Opcodes.IFNULL:
+ ifnull(label);
+ break;
+ case Opcodes.IFNONNULL:
+ ifnonnull(label);
+ break;
+ default:
+ throw new IllegalArgumentException();
}
}
@@ -644,14 +630,13 @@ public class InstructionAdapter extends MethodVisitor {
}
@Override
- public void visitTableSwitchInsn(final int min, final int max,
- final Label dflt, final Label... labels) {
+ public void visitTableSwitchInsn(final int min, final int max, final Label dflt,
+ final Label... labels) {
tableswitch(min, max, dflt, labels);
}
@Override
- public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
- final Label[] labels) {
+ public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
lookupswitch(dflt, keys, labels);
}
@@ -951,13 +936,11 @@ public class InstructionAdapter extends MethodVisitor {
mv.visitVarInsn(Opcodes.RET, var);
}
- public void tableswitch(final int min, final int max, final Label dflt,
- final Label... labels) {
+ public void tableswitch(final int min, final int max, final Label dflt, final Label... labels) {
mv.visitTableSwitchInsn(min, max, dflt, labels);
}
- public void lookupswitch(final Label dflt, final int[] keys,
- final Label[] labels) {
+ public void lookupswitch(final Label dflt, final int[] keys, final Label[] labels) {
mv.visitLookupSwitchInsn(dflt, keys, labels);
}
@@ -965,48 +948,39 @@ public class InstructionAdapter extends MethodVisitor {
mv.visitInsn(t.getOpcode(Opcodes.IRETURN));
}
- public void getstatic(final String owner, final String name,
- final String desc) {
+ public void getstatic(final String owner, final String name, final String desc) {
mv.visitFieldInsn(Opcodes.GETSTATIC, owner, name, desc);
}
- public void putstatic(final String owner, final String name,
- final String desc) {
+ public void putstatic(final String owner, final String name, final String desc) {
mv.visitFieldInsn(Opcodes.PUTSTATIC, owner, name, desc);
}
- public void getfield(final String owner, final String name,
- final String desc) {
+ public void getfield(final String owner, final String name, final String desc) {
mv.visitFieldInsn(Opcodes.GETFIELD, owner, name, desc);
}
- public void putfield(final String owner, final String name,
- final String desc) {
+ public void putfield(final String owner, final String name, final String desc) {
mv.visitFieldInsn(Opcodes.PUTFIELD, owner, name, desc);
}
- public void invokevirtual(final String owner, final String name,
- final String desc) {
+ public void invokevirtual(final String owner, final String name, final String desc) {
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, owner, name, desc);
}
- public void invokespecial(final String owner, final String name,
- final String desc) {
+ public void invokespecial(final String owner, final String name, final String desc) {
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, owner, name, desc);
}
- public void invokestatic(final String owner, final String name,
- final String desc) {
+ public void invokestatic(final String owner, final String name, final String desc) {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc);
}
- public void invokeinterface(final String owner, final String name,
- final String desc) {
+ public void invokeinterface(final String owner, final String name, final String desc) {
mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, owner, name, desc);
}
- public void invokedynamic(String name, String desc, Handle bsm,
- Object[] bsmArgs) {
+ public void invokedynamic(String name, String desc, Handle bsm, Object[] bsmArgs) {
mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
}
@@ -1017,33 +991,33 @@ public class InstructionAdapter extends MethodVisitor {
public void newarray(final Type type) {
int typ;
switch (type.getSort()) {
- case Type.BOOLEAN:
- typ = Opcodes.T_BOOLEAN;
- break;
- case Type.CHAR:
- typ = Opcodes.T_CHAR;
- break;
- case Type.BYTE:
- typ = Opcodes.T_BYTE;
- break;
- case Type.SHORT:
- typ = Opcodes.T_SHORT;
- break;
- case Type.INT:
- typ = Opcodes.T_INT;
- break;
- case Type.FLOAT:
- typ = Opcodes.T_FLOAT;
- break;
- case Type.LONG:
- typ = Opcodes.T_LONG;
- break;
- case Type.DOUBLE:
- typ = Opcodes.T_DOUBLE;
- break;
- default:
- mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName());
- return;
+ case Type.BOOLEAN:
+ typ = Opcodes.T_BOOLEAN;
+ break;
+ case Type.CHAR:
+ typ = Opcodes.T_CHAR;
+ break;
+ case Type.BYTE:
+ typ = Opcodes.T_BYTE;
+ break;
+ case Type.SHORT:
+ typ = Opcodes.T_SHORT;
+ break;
+ case Type.INT:
+ typ = Opcodes.T_INT;
+ break;
+ case Type.FLOAT:
+ typ = Opcodes.T_FLOAT;
+ break;
+ case Type.LONG:
+ typ = Opcodes.T_LONG;
+ break;
+ case Type.DOUBLE:
+ typ = Opcodes.T_DOUBLE;
+ break;
+ default:
+ mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName());
+ return;
}
mv.visitIntInsn(Opcodes.NEWARRAY, typ);
}
diff --git a/src/main/asm/org/objectweb/asm/commons/JSRInlinerAdapter.java b/src/main/asm/org/objectweb/asm/commons/JSRInlinerAdapter.java
index a8325fd..2aafc47 100644
--- a/src/main/asm/org/objectweb/asm/commons/JSRInlinerAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/JSRInlinerAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -55,8 +47,8 @@ import org.objectweb.asm.tree.TableSwitchInsnNode;
import org.objectweb.asm.tree.TryCatchBlockNode;
/**
- * A {@link org.objectweb.asm.MethodVisitor} that removes JSR instructions and
- * inlines the referenced subroutines.
+ * A {@link org.objectweb.asm.MethodVisitor} that removes JSR instructions and inlines the
+ * referenced subroutines.
*
* Explanation of how it works TODO
*
@@ -72,82 +64,61 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
private final Map subroutineHeads = new HashMap();
/**
- * This subroutine instance denotes the line of execution that is not
- * contained within any subroutine; i.e., the "subroutine" that is executing
- * when a method first begins.
+ * This subroutine instance denotes the line of execution that is not contained within any
+ * subroutine; i.e., the "subroutine" that is executing when a method first begins.
*/
private final BitSet mainSubroutine = new BitSet();
/**
- * This BitSet contains the index of every instruction that belongs to more
- * than one subroutine. This should not happen often.
+ * This BitSet contains the index of every instruction that belongs to more than one subroutine.
+ * This should not happen often.
*/
final BitSet dualCitizens = new BitSet();
/**
- * Creates a new JSRInliner. Subclasses must not use this
- * constructor . Instead, they must use the
- * {@link #JSRInlinerAdapter(int, MethodVisitor, int, String, String, String, String[])}
+ * Creates a new JSRInliner. Subclasses must not use this constructor . Instead, they must
+ * use the {@link #JSRInlinerAdapter(int, MethodVisitor, int, String, String, String, String[])}
* version.
*
- * @param mv
- * the MethodVisitor
to send the resulting inlined
- * method code to (use null
for none).
- * @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 Type}).
- * @param signature
- * the method's signature. May be null .
- * @param exceptions
- * the internal names of the method's exception classes (see
- * {@link Type#getInternalName() getInternalName}). May be
- * null .
+ * @param mv the MethodVisitor
to send the resulting inlined method code to (use
+ * null
for none).
+ * @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 Type}).
+ * @param signature the method's signature. May be null .
+ * @param exceptions the internal names of the method's exception classes (see
+ * {@link Type#getInternalName() getInternalName}). May be null .
*/
- public JSRInlinerAdapter(final MethodVisitor mv, final int access,
- final String name, final String desc, final String signature,
- final String[] exceptions) {
+ public JSRInlinerAdapter(final MethodVisitor mv, final int access, final String name,
+ final String desc, final String signature, final String[] exceptions) {
this(Opcodes.ASM4, mv, access, name, desc, signature, exceptions);
}
/**
* Creates a new JSRInliner.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param mv
- * the MethodVisitor
to send the resulting inlined
- * method code to (use null
for none).
- * @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 Type}).
- * @param signature
- * the method's signature. May be null .
- * @param exceptions
- * the internal names of the method's exception classes (see
- * {@link Type#getInternalName() getInternalName}). May be
- * null .
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param mv the MethodVisitor
to send the resulting inlined method code to (use
+ * null
for none).
+ * @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 Type}).
+ * @param signature the method's signature. May be null .
+ * @param exceptions the internal names of the method's exception classes (see
+ * {@link Type#getInternalName() getInternalName}). May be null .
*/
- protected JSRInlinerAdapter(final int api, final MethodVisitor mv,
- final int access, final String name, final String desc,
- final String signature, final String[] exceptions) {
+ protected JSRInlinerAdapter(final int api, final MethodVisitor mv, final int access,
+ final String name, final String desc, final String signature,
+ final String[] exceptions) {
super(api, access, name, desc, signature, exceptions);
this.mv = mv;
}
/**
- * Detects a JSR instruction and sets a flag to indicate we will need to do
- * inlining.
+ * Detects a JSR instruction and sets a flag to indicate we will need to do inlining.
*/
@Override
public void visitJumpInsn(final int opcode, final Label lbl) {
@@ -159,8 +130,8 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * If any JSRs were seen, triggers the inlining process. Otherwise, forwards
- * the byte codes untouched.
+ * If any JSRs were seen, triggers the inlining process. Otherwise, forwards the byte codes
+ * untouched.
*/
@Override
public void visitEnd() {
@@ -184,8 +155,8 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Walks the method and determines which internal subroutine(s), if any,
- * each instruction is a method of.
+ * Walks the method and determines which internal subroutine(s), if any, each instruction is a
+ * method of.
*/
private void markSubroutines() {
BitSet anyvisited = new BitSet();
@@ -196,8 +167,8 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
// Go through the head of each subroutine and find any nodes reachable
// to that subroutine without following any JSR links.
- for (Iterator> it = subroutineHeads
- .entrySet().iterator(); it.hasNext();) {
+ for (Iterator> it = subroutineHeads.entrySet().iterator(); it
+ .hasNext();) {
Map.Entry entry = it.next();
LabelNode lab = entry.getKey();
BitSet sub = entry.getValue();
@@ -207,23 +178,18 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Performs a depth first search walking the normal byte code path starting
- * at index
, and adding each instruction encountered into the
- * subroutine sub
. After this walk is complete, iterates over
- * the exception handlers to ensure that we also include those byte codes
- * which are reachable through an exception that may be thrown during the
- * execution of the subroutine. Invoked from markSubroutines()
.
+ * Performs a depth first search walking the normal byte code path starting at
+ * index
, and adding each instruction encountered into the subroutine
+ * sub
. After this walk is complete, iterates over the exception handlers to ensure
+ * that we also include those byte codes which are reachable through an exception that may be
+ * thrown during the execution of the subroutine. Invoked from markSubroutines()
.
*
- * @param sub
- * the subroutine whose instructions must be computed.
- * @param index
- * an instruction of this subroutine.
- * @param anyvisited
- * indexes of the already visited instructions, i.e. marked as
- * part of this subroutine or any previously computed subroutine.
+ * @param sub the subroutine whose instructions must be computed.
+ * @param index an instruction of this subroutine.
+ * @param anyvisited indexes of the already visited instructions, i.e. marked as part of this
+ * subroutine or any previously computed subroutine.
*/
- private void markSubroutineWalk(final BitSet sub, final int index,
- final BitSet anyvisited) {
+ private void markSubroutineWalk(final BitSet sub, final int index, final BitSet anyvisited) {
if (LOGGING) {
log("markSubroutineWalk: sub=" + sub + " index=" + index);
}
@@ -235,8 +201,7 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
boolean loop = true;
while (loop) {
loop = false;
- for (Iterator it = tryCatchBlocks.iterator(); it
- .hasNext();) {
+ for (Iterator it = tryCatchBlocks.iterator(); it.hasNext();) {
TryCatchBlockNode trycatch = it.next();
if (LOGGING) {
@@ -255,9 +220,8 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
int nextbit = sub.nextSetBit(startindex);
if (nextbit != -1 && nextbit < endindex) {
if (LOGGING) {
- log("Adding exception handler: " + startindex + '-'
- + endindex + " due to " + nextbit + " handler "
- + handlerindex);
+ log("Adding exception handler: " + startindex + '-' + endindex + " due to "
+ + nextbit + " handler " + handlerindex);
}
markSubroutineWalkDFS(sub, handlerindex, anyvisited);
loop = true;
@@ -267,20 +231,15 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Performs a simple DFS of the instructions, assigning each to the
- * subroutine sub
. Starts from index
. Invoked only
- * by markSubroutineWalk()
.
+ * Performs a simple DFS of the instructions, assigning each to the subroutine sub
.
+ * Starts from index
. Invoked only by markSubroutineWalk()
.
*
- * @param sub
- * the subroutine whose instructions must be computed.
- * @param index
- * an instruction of this subroutine.
- * @param anyvisited
- * indexes of the already visited instructions, i.e. marked as
- * part of this subroutine or any previously computed subroutine.
+ * @param sub the subroutine whose instructions must be computed.
+ * @param index an instruction of this subroutine.
+ * @param anyvisited indexes of the already visited instructions, i.e. marked as part of this
+ * subroutine or any previously computed subroutine.
*/
- private void markSubroutineWalkDFS(final BitSet sub, int index,
- final BitSet anyvisited) {
+ private void markSubroutineWalkDFS(final BitSet sub, int index, final BitSet anyvisited) {
while (true) {
AbstractInsnNode node = instructions.get(index);
@@ -299,8 +258,7 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
anyvisited.set(index);
- if (node.getType() == AbstractInsnNode.JUMP_INSN
- && node.getOpcode() != JSR) {
+ if (node.getType() == AbstractInsnNode.JUMP_INSN && node.getOpcode() != JSR) {
// we do not follow recursively called subroutines here; but any
// other sort of branch we do follow
JumpInsnNode jnode = (JumpInsnNode) node;
@@ -331,22 +289,22 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
// check to see if this opcode falls through to the next instruction
// or not; if not, return.
switch (instructions.get(index).getOpcode()) {
- case GOTO:
- case RET:
- case TABLESWITCH:
- case LOOKUPSWITCH:
- case IRETURN:
- case LRETURN:
- case FRETURN:
- case DRETURN:
- case ARETURN:
- case RETURN:
- case ATHROW:
- /*
- * note: this either returns from this subroutine, or a parent
- * subroutine which invoked it
- */
- return;
+ case GOTO:
+ case RET:
+ case TABLESWITCH:
+ case LOOKUPSWITCH:
+ case IRETURN:
+ case LRETURN:
+ case FRETURN:
+ case DRETURN:
+ case ARETURN:
+ case RETURN:
+ case ATHROW:
+ /*
+ * note: this either returns from this subroutine, or a parent subroutine which
+ * invoked it
+ */
+ return;
}
// Use tail recursion here in the form of an outer while loop to
@@ -367,8 +325,8 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Creates the new instructions, inlining each instantiation of each
- * subroutine until the code is fully elaborated.
+ * Creates the new instructions, inlining each instantiation of each subroutine until the code
+ * is fully elaborated.
*/
private void emitCode() {
LinkedList worklist = new LinkedList();
@@ -383,8 +341,7 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
List newLocalVariables = new ArrayList();
while (!worklist.isEmpty()) {
Instantiation inst = worklist.removeFirst();
- emitSubroutine(inst, worklist, newInstructions, newTryCatchBlocks,
- newLocalVariables);
+ emitSubroutine(inst, worklist, newInstructions, newTryCatchBlocks, newLocalVariables);
}
instructions = newInstructions;
tryCatchBlocks = newTryCatchBlocks;
@@ -392,25 +349,18 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Emits one instantiation of one subroutine, specified by
- * instant
. May add new instantiations that are invoked by this
- * one to the worklist
parameter, and new try/catch blocks to
- * newTryCatchBlocks
.
+ * Emits one instantiation of one subroutine, specified by instant
. May add new
+ * instantiations that are invoked by this one to the worklist
parameter, and new
+ * try/catch blocks to newTryCatchBlocks
.
*
- * @param instant
- * the instantiation that must be performed.
- * @param worklist
- * list of the instantiations that remain to be done.
- * @param newInstructions
- * the instruction list to which the instantiated code must be
- * appended.
- * @param newTryCatchBlocks
- * the exception handler list to which the instantiated handlers
- * must be appended.
+ * @param instant the instantiation that must be performed.
+ * @param worklist list of the instantiations that remain to be done.
+ * @param newInstructions the instruction list to which the instantiated code must be appended.
+ * @param newTryCatchBlocks the exception handler list to which the instantiated handlers must
+ * be appended.
*/
- private void emitSubroutine(final Instantiation instant,
- final List worklist, final InsnList newInstructions,
- final List newTryCatchBlocks,
+ private void emitSubroutine(final Instantiation instant, final List worklist,
+ final InsnList newInstructions, final List newTryCatchBlocks,
final List newLocalVariables) {
LabelNode duplbl = null;
@@ -476,8 +426,8 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
// This is only possible if the mainSubroutine owns a RET
// instruction, which should never happen for verifiable
// code.
- throw new RuntimeException("Instruction #" + i
- + " is a RET not owned by any subroutine");
+ throw new RuntimeException(
+ "Instruction #" + i + " is a RET not owned by any subroutine");
}
newInstructions.add(new JumpInsnNode(GOTO, retlabel));
} else if (insn.getOpcode() == JSR) {
@@ -508,14 +458,13 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
// Emit try/catch blocks that are relevant to this method.
- for (Iterator it = tryCatchBlocks.iterator(); it
- .hasNext();) {
+ for (Iterator it = tryCatchBlocks.iterator(); it.hasNext();) {
TryCatchBlockNode trycatch = it.next();
if (LOGGING) {
// TODO use of default toString().
- log("try catch block original labels=" + trycatch.start + '-'
- + trycatch.end + "->" + trycatch.handler);
+ log("try catch block original labels=" + trycatch.start + '-' + trycatch.end + "->"
+ + trycatch.handler);
}
final LabelNode start = instant.rangeLabel(trycatch.start);
@@ -533,20 +482,17 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
if (LOGGING) {
// TODO use of default toString().
- log(" try catch block new labels=" + start + '-' + end + "->"
- + handler);
+ log(" try catch block new labels=" + start + '-' + end + "->" + handler);
}
if (start == null || end == null || handler == null) {
throw new RuntimeException("Internal error!");
}
- newTryCatchBlocks.add(new TryCatchBlockNode(start, end, handler,
- trycatch.type));
+ newTryCatchBlocks.add(new TryCatchBlockNode(start, end, handler, trycatch.type));
}
- for (Iterator it = localVariables.iterator(); it
- .hasNext();) {
+ for (Iterator it = localVariables.iterator(); it.hasNext();) {
LocalVariableNode lvnode = it.next();
if (LOGGING) {
log("local var " + lvnode.name);
@@ -559,8 +505,8 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
continue;
}
- newLocalVariables.add(new LocalVariableNode(lvnode.name,
- lvnode.desc, lvnode.signature, start, end, lvnode.index));
+ newLocalVariables.add(new LocalVariableNode(lvnode.name, lvnode.desc, lvnode.signature,
+ start, end, lvnode.index));
}
}
@@ -569,18 +515,16 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * A class that represents an instantiation of a subroutine. Each
- * instantiation has an associate "stack" --- which is a listing of those
- * instantiations that were active when this particular instance of this
- * subroutine was invoked. Each instantiation also has a map from the
- * original labels of the program to the labels appropriate for this
- * instantiation, and finally a label to return to.
+ * A class that represents an instantiation of a subroutine. Each instantiation has an associate
+ * "stack" --- which is a listing of those instantiations that were active when this particular
+ * instance of this subroutine was invoked. Each instantiation also has a map from the original
+ * labels of the program to the labels appropriate for this instantiation, and finally a label
+ * to return to.
*/
private class Instantiation extends AbstractMap {
/**
- * Previous instantiations; the stack must be statically predictable to
- * be inlinable.
+ * Previous instantiations; the stack must be statically predictable to be inlinable.
*/
final Instantiation previous;
@@ -590,15 +534,13 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
public final BitSet subroutine;
/**
- * This table maps Labels from the original source to Labels pointing at
- * code specific to this instantiation, for use in remapping try/catch
- * blocks,as well as gotos.
+ * This table maps Labels from the original source to Labels pointing at code specific to
+ * this instantiation, for use in remapping try/catch blocks,as well as gotos.
*
- * Note that in the presence of dual citizens instructions, that is,
- * instructions which belong to more than one subroutine due to the
- * merging of control flow without a RET instruction, we will map the
- * target label of a GOTO to the label used by the instantiation lowest
- * on the stack. This avoids code duplication during inlining in most
+ * Note that in the presence of dual citizens instructions, that is, instructions which
+ * belong to more than one subroutine due to the merging of control flow without a RET
+ * instruction, we will map the target label of a GOTO to the label used by the
+ * instantiation lowest on the stack. This avoids code duplication during inlining in most
* cases.
*
* @see #findOwner(int)
@@ -660,27 +602,23 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Returns the "owner" of a particular instruction relative to this
- * instantiation: the owner referes to the Instantiation which will emit
- * the version of this instruction that we will execute.
+ * Returns the "owner" of a particular instruction relative to this instantiation: the owner
+ * referes to the Instantiation which will emit the version of this instruction that we will
+ * execute.
*
- * Typically, the return value is either this
or
- * null
. this
indicates that this
- * instantiation will generate the version of this instruction that we
- * will execute, and null
indicates that this instantiation
+ * Typically, the return value is either this
or null
.
+ * this
indicates that this instantiation will generate the version of this
+ * instruction that we will execute, and null
indicates that this instantiation
* never executes the given instruction.
*
- * Sometimes, however, an instruction can belong to multiple
- * subroutines; this is called a "dual citizen" instruction (though it
- * may belong to more than 2 subroutines), and occurs when multiple
- * subroutines branch to common points of control. In this case, the
- * owner is the subroutine that appears lowest on the stack, and which
- * also owns the instruction in question.
+ * Sometimes, however, an instruction can belong to multiple subroutines; this is called a
+ * "dual citizen" instruction (though it may belong to more than 2 subroutines), and occurs
+ * when multiple subroutines branch to common points of control. In this case, the owner is
+ * the subroutine that appears lowest on the stack, and which also owns the instruction in
+ * question.
*
- * @param i
- * the index of the instruction in the original code
- * @return the "owner" of a particular instruction relative to this
- * instantiation.
+ * @param i the index of the instruction in the original code
+ * @return the "owner" of a particular instruction relative to this instantiation.
*/
public Instantiation findOwner(final int i) {
if (!subroutine.get(i)) {
@@ -699,13 +637,11 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Looks up the label l
in the gotoTable
, thus
- * translating it from a Label in the original code, to a Label in the
- * inlined code that is appropriate for use by an instruction that
- * branched to the original label.
+ * Looks up the label l
in the gotoTable
, thus translating it from
+ * a Label in the original code, to a Label in the inlined code that is appropriate for use
+ * by an instruction that branched to the original label.
*
- * @param l
- * The label we will be translating
+ * @param l The label we will be translating
* @return a label for use by a branch instruction in the inlined code
* @see #rangeLabel
*/
@@ -717,15 +653,12 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
}
/**
- * Looks up the label l
in the rangeTable
,
- * thus translating it from a Label in the original code, to a Label in
- * the inlined code that is appropriate for use by an try/catch or
- * variable use annotation.
+ * Looks up the label l
in the rangeTable
, thus translating it
+ * from a Label in the original code, to a Label in the inlined code that is appropriate for
+ * use by an try/catch or variable use annotation.
*
- * @param l
- * The label we will be translating
- * @return a label for use by a try/catch or variable annotation in the
- * original code
+ * @param l The label we will be translating
+ * @return a label for use by a try/catch or variable annotation in the original code
* @see #rangeTable
*/
public LabelNode rangeLabel(final LabelNode l) {
diff --git a/src/main/asm/org/objectweb/asm/commons/LocalVariablesSorter.java b/src/main/asm/org/objectweb/asm/commons/LocalVariablesSorter.java
index 09eef09..cf2412d 100644
--- a/src/main/asm/org/objectweb/asm/commons/LocalVariablesSorter.java
+++ b/src/main/asm/org/objectweb/asm/commons/LocalVariablesSorter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -35,12 +27,11 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
/**
- * A {@link MethodVisitor} that renumbers local variables in their order of
- * appearance. This adapter allows one to easily add new local variables to a
- * method. It may be used by inheriting from this class, but the preferred way
- * of using it is via delegation: the next visitor in the chain can indeed add
- * new locals when needed by calling {@link #newLocal} on this adapter (this
- * requires a reference back to this {@link LocalVariablesSorter}).
+ * A {@link MethodVisitor} that renumbers local variables in their order of appearance. This adapter
+ * allows one to easily add new local variables to a method. It may be used by inheriting from this
+ * class, but the preferred way of using it is via delegation: the next visitor in the chain can
+ * indeed add new locals when needed by calling {@link #newLocal} on this adapter (this requires a
+ * reference back to this {@link LocalVariablesSorter}).
*
* @author Chris Nokleberg
* @author Eugene Kuleshov
@@ -48,13 +39,12 @@ import org.objectweb.asm.Type;
*/
public class LocalVariablesSorter extends MethodVisitor {
- private static final Type OBJECT_TYPE = Type
- .getObjectType("java/lang/Object");
+ private static final Type OBJECT_TYPE = Type.getObjectType("java/lang/Object");
/**
- * Mapping from old to new local variable indexes. A local variable at index
- * i of size 1 is remapped to 'mapping[2*i]', while a local variable at
- * index i of size 2 is remapped to 'mapping[2*i+1]'.
+ * Mapping from old to new local variable indexes. A local variable at index i of size 1 is
+ * remapped to 'mapping[2*i]', while a local variable at index i of size 2 is remapped to
+ * 'mapping[2*i+1]'.
*/
private int[] mapping = new int[40];
@@ -79,37 +69,29 @@ public class LocalVariablesSorter extends MethodVisitor {
private boolean changed;
/**
- * Creates a new {@link LocalVariablesSorter}. Subclasses must not use
- * this constructor . Instead, they must use the
- * {@link #LocalVariablesSorter(int, int, String, MethodVisitor)} version.
+ * Creates a new {@link LocalVariablesSorter}. Subclasses must not use this constructor .
+ * Instead, they must use the {@link #LocalVariablesSorter(int, int, String, MethodVisitor)}
+ * version.
*
- * @param access
- * access flags of the adapted method.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- * @param mv
- * the method visitor to which this adapter delegates calls.
+ * @param access access flags of the adapted method.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ * @param mv the method visitor to which this adapter delegates calls.
*/
- public LocalVariablesSorter(final int access, final String desc,
- final MethodVisitor mv) {
+ public LocalVariablesSorter(final int access, final String desc, final MethodVisitor mv) {
this(Opcodes.ASM4, access, desc, mv);
}
/**
* Creates a new {@link LocalVariablesSorter}.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param access
- * access flags of the adapted method.
- * @param desc
- * the method's descriptor (see {@link Type Type}).
- * @param mv
- * the method visitor to which this adapter delegates calls.
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param access access flags of the adapted method.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ * @param mv the method visitor to which this adapter delegates calls.
*/
- protected LocalVariablesSorter(final int api, final int access,
- final String desc, final MethodVisitor mv) {
+ protected LocalVariablesSorter(final int api, final int access, final String desc,
+ final MethodVisitor mv) {
super(api, mv);
Type[] args = Type.getArgumentTypes(desc);
nextLocal = (Opcodes.ACC_STATIC & access) == 0 ? 1 : 0;
@@ -123,32 +105,32 @@ public class LocalVariablesSorter extends MethodVisitor {
public void visitVarInsn(final int opcode, final int var) {
Type type;
switch (opcode) {
- case Opcodes.LLOAD:
- case Opcodes.LSTORE:
- type = Type.LONG_TYPE;
- break;
+ case Opcodes.LLOAD:
+ case Opcodes.LSTORE:
+ type = Type.LONG_TYPE;
+ break;
- case Opcodes.DLOAD:
- case Opcodes.DSTORE:
- type = Type.DOUBLE_TYPE;
- break;
+ case Opcodes.DLOAD:
+ case Opcodes.DSTORE:
+ type = Type.DOUBLE_TYPE;
+ break;
- case Opcodes.FLOAD:
- case Opcodes.FSTORE:
- type = Type.FLOAT_TYPE;
- break;
+ case Opcodes.FLOAD:
+ case Opcodes.FSTORE:
+ type = Type.FLOAT_TYPE;
+ break;
- case Opcodes.ILOAD:
- case Opcodes.ISTORE:
- type = Type.INT_TYPE;
- break;
+ case Opcodes.ILOAD:
+ case Opcodes.ISTORE:
+ type = Type.INT_TYPE;
+ break;
- default:
- // case Opcodes.ALOAD:
- // case Opcodes.ASTORE:
- // case RET:
- type = OBJECT_TYPE;
- break;
+ default:
+ // case Opcodes.ALOAD:
+ // case Opcodes.ASTORE:
+ // case RET:
+ type = OBJECT_TYPE;
+ break;
}
mv.visitVarInsn(opcode, remap(var, type));
}
@@ -164,16 +146,15 @@ public class LocalVariablesSorter extends MethodVisitor {
}
@Override
- public void visitLocalVariable(final String name, final String desc,
- final String signature, final Label start, final Label end,
- final int index) {
+ public void visitLocalVariable(final String name, final String desc, final String signature,
+ final Label start, final Label end, final int index) {
int newIndex = remap(index, Type.getType(desc));
mv.visitLocalVariable(name, desc, signature, start, end, newIndex);
}
@Override
- public void visitFrame(final int type, final int nLocal,
- final Object[] local, final int nStack, final Object[] stack) {
+ public void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack,
+ final Object[] stack) {
if (type != Opcodes.F_NEW) { // uncompressed frame
throw new IllegalStateException(
"ClassReader.accept() should be called with EXPAND_FRAMES flag");
@@ -245,36 +226,35 @@ public class LocalVariablesSorter extends MethodVisitor {
/**
* Creates a new local variable of the given type.
*
- * @param type
- * the type of the local variable to be created.
+ * @param type the type of the local variable to be created.
* @return the identifier of the newly created local variable.
*/
public int newLocal(final Type type) {
Object t;
switch (type.getSort()) {
- case Type.BOOLEAN:
- case Type.CHAR:
- case Type.BYTE:
- case Type.SHORT:
- case Type.INT:
- t = Opcodes.INTEGER;
- break;
- case Type.FLOAT:
- t = Opcodes.FLOAT;
- break;
- case Type.LONG:
- t = Opcodes.LONG;
- break;
- case Type.DOUBLE:
- t = Opcodes.DOUBLE;
- break;
- case Type.ARRAY:
- t = type.getDescriptor();
- break;
- // case Type.OBJECT:
- default:
- t = type.getInternalName();
- break;
+ case Type.BOOLEAN:
+ case Type.CHAR:
+ case Type.BYTE:
+ case Type.SHORT:
+ case Type.INT:
+ t = Opcodes.INTEGER;
+ break;
+ case Type.FLOAT:
+ t = Opcodes.FLOAT;
+ break;
+ case Type.LONG:
+ t = Opcodes.LONG;
+ break;
+ case Type.DOUBLE:
+ t = Opcodes.DOUBLE;
+ break;
+ case Type.ARRAY:
+ t = type.getDescriptor();
+ break;
+ // case Type.OBJECT:
+ default:
+ t = type.getInternalName();
+ break;
}
int local = newLocalMapping(type);
setLocalType(local, type);
@@ -284,39 +264,30 @@ public class LocalVariablesSorter extends MethodVisitor {
}
/**
- * Notifies subclasses that a new stack map frame is being visited. The
- * array argument contains the stack map frame types corresponding to the
- * local variables added with {@link #newLocal}. This method can update
- * these types in place for the stack map frame being visited. The default
- * implementation of this method does nothing, i.e. a local variable added
- * with {@link #newLocal} will have the same type in all stack map frames.
- * But this behavior is not always the desired one, for instance if a local
- * variable is added in the middle of a try/catch block: the frame for the
- * exception handler should have a TOP type for this new local.
+ * Notifies subclasses that a new stack map frame is being visited. The array argument contains
+ * the stack map frame types corresponding to the local variables added with {@link #newLocal}.
+ * This method can update these types in place for the stack map frame being visited. The
+ * default implementation of this method does nothing, i.e. a local variable added with
+ * {@link #newLocal} will have the same type in all stack map frames. But this behavior is not
+ * always the desired one, for instance if a local variable is added in the middle of a
+ * try/catch block: the frame for the exception handler should have a TOP type for this new
+ * local.
*
- * @param newLocals
- * the stack map frame types corresponding to the local variables
- * added with {@link #newLocal} (and null for the others). The
- * format of this array is the same as in
- * {@link MethodVisitor#visitFrame}, except that long and double
- * types use two slots. The types for the current stack map frame
- * must be updated in place in this array.
+ * @param newLocals the stack map frame types corresponding to the local variables added with
+ * {@link #newLocal} (and null for the others). The format of this array is the same as
+ * in {@link MethodVisitor#visitFrame}, except that long and double types use two slots.
+ * The types for the current stack map frame must be updated in place in this array.
*/
- protected void updateNewLocals(Object[] newLocals) {
- }
+ protected void updateNewLocals(Object[] newLocals) {}
/**
- * Notifies subclasses that a local variable has been added or remapped. The
- * default implementation of this method does nothing.
+ * Notifies subclasses that a local variable has been added or remapped. The default
+ * implementation of this method does nothing.
*
- * @param local
- * a local variable identifier, as returned by {@link #newLocal
- * newLocal()}.
- * @param type
- * the type of the value being stored in the local variable.
+ * @param local a local variable identifier, as returned by {@link #newLocal newLocal()}.
+ * @param type the type of the value being stored in the local variable.
*/
- protected void setLocalType(final int local, final Type type) {
- }
+ protected void setLocalType(final int local, final Type type) {}
private void setFrameLocal(final int local, final Object type) {
int l = newLocals.length;
diff --git a/src/main/asm/org/objectweb/asm/commons/Method.java b/src/main/asm/org/objectweb/asm/commons/Method.java
index 25c3660..082f2f1 100644
--- a/src/main/asm/org/objectweb/asm/commons/Method.java
+++ b/src/main/asm/org/objectweb/asm/commons/Method.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -74,10 +66,8 @@ public class Method {
/**
* Creates a new {@link Method}.
*
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor.
+ * @param name the method's name.
+ * @param desc the method's descriptor.
*/
public Method(final String name, final String desc) {
this.name = name;
@@ -87,25 +77,19 @@ public class Method {
/**
* Creates a new {@link Method}.
*
- * @param name
- * the method's name.
- * @param returnType
- * the method's return type.
- * @param argumentTypes
- * the method's argument types.
+ * @param name the method's name.
+ * @param returnType the method's return type.
+ * @param argumentTypes the method's argument types.
*/
- public Method(final String name, final Type returnType,
- final Type[] argumentTypes) {
+ public Method(final String name, final Type returnType, final Type[] argumentTypes) {
this(name, Type.getMethodDescriptor(returnType, argumentTypes));
}
/**
* Creates a new {@link Method}.
*
- * @param m
- * a java.lang.reflect method descriptor
- * @return a {@link Method} corresponding to the given Java method
- * declaration.
+ * @param m a java.lang.reflect method descriptor
+ * @return a {@link Method} corresponding to the given Java method declaration.
*/
public static Method getMethod(java.lang.reflect.Method m) {
return new Method(m.getName(), Type.getMethodDescriptor(m));
@@ -114,60 +98,43 @@ public class Method {
/**
* Creates a new {@link Method}.
*
- * @param c
- * a java.lang.reflect constructor descriptor
- * @return a {@link Method} corresponding to the given Java constructor
- * declaration.
+ * @param c a java.lang.reflect constructor descriptor
+ * @return a {@link Method} corresponding to the given Java constructor declaration.
*/
public static Method getMethod(java.lang.reflect.Constructor> c) {
return new Method("", Type.getConstructorDescriptor(c));
}
/**
- * Returns a {@link Method} corresponding to the given Java method
- * declaration.
+ * Returns a {@link Method} corresponding to the given Java method declaration.
*
- * @param method
- * a Java method declaration, without argument names, of the form
- * "returnType name (argumentType1, ... argumentTypeN)", where
- * the types are in plain Java (e.g. "int", "float",
- * "java.util.List", ...). Classes of the java.lang package can
- * be specified by their unqualified name; all other classes
- * names must be fully qualified.
- * @return a {@link Method} corresponding to the given Java method
- * declaration.
- * @throws IllegalArgumentException
- * if method
could not get parsed.
+ * @param method a Java method declaration, without argument names, of the form "returnType name
+ * (argumentType1, ... argumentTypeN)", where the types are in plain Java (e.g. "int",
+ * "float", "java.util.List", ...). Classes of the java.lang package can be specified by
+ * their unqualified name; all other classes names must be fully qualified.
+ * @return a {@link Method} corresponding to the given Java method declaration.
+ * @throws IllegalArgumentException if method
could not get parsed.
*/
- public static Method getMethod(final String method)
- throws IllegalArgumentException {
+ public static Method getMethod(final String method) throws IllegalArgumentException {
return getMethod(method, false);
}
/**
- * Returns a {@link Method} corresponding to the given Java method
- * declaration.
+ * Returns a {@link Method} corresponding to the given Java method declaration.
*
- * @param method
- * a Java method declaration, without argument names, of the form
- * "returnType name (argumentType1, ... argumentTypeN)", where
- * the types are in plain Java (e.g. "int", "float",
- * "java.util.List", ...). Classes of the java.lang package may
- * be specified by their unqualified name, depending on the
- * defaultPackage argument; all other classes names must be fully
- * qualified.
- * @param defaultPackage
- * true if unqualified class names belong to the default package,
- * or false if they correspond to java.lang classes. For instance
- * "Object" means "Object" if this option is true, or
- * "java.lang.Object" otherwise.
- * @return a {@link Method} corresponding to the given Java method
- * declaration.
- * @throws IllegalArgumentException
- * if method
could not get parsed.
+ * @param method a Java method declaration, without argument names, of the form "returnType name
+ * (argumentType1, ... argumentTypeN)", where the types are in plain Java (e.g. "int",
+ * "float", "java.util.List", ...). Classes of the java.lang package may be specified by
+ * their unqualified name, depending on the defaultPackage argument; all other classes
+ * names must be fully qualified.
+ * @param defaultPackage true if unqualified class names belong to the default package, or false
+ * if they correspond to java.lang classes. For instance "Object" means "Object" if this
+ * option is true, or "java.lang.Object" otherwise.
+ * @return a {@link Method} corresponding to the given Java method declaration.
+ * @throws IllegalArgumentException if method
could not get parsed.
*/
- public static Method getMethod(final String method,
- final boolean defaultPackage) throws IllegalArgumentException {
+ public static Method getMethod(final String method, final boolean defaultPackage)
+ throws IllegalArgumentException {
int space = method.indexOf(' ');
int start = method.indexOf('(', space) + 1;
int end = method.indexOf(')', start);
@@ -279,4 +246,4 @@ public class Method {
public int hashCode() {
return name.hashCode() ^ desc.hashCode();
}
-}
\ No newline at end of file
+}
diff --git a/src/main/asm/org/objectweb/asm/commons/Remapper.java b/src/main/asm/org/objectweb/asm/commons/Remapper.java
index 9c359fb..9115caa 100644
--- a/src/main/asm/org/objectweb/asm/commons/Remapper.java
+++ b/src/main/asm/org/objectweb/asm/commons/Remapper.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -37,8 +29,7 @@ import org.objectweb.asm.signature.SignatureVisitor;
import org.objectweb.asm.signature.SignatureWriter;
/**
- * A class responsible for remapping types and names. Subclasses can override
- * the following methods:
+ * A class responsible for remapping types and names. Subclasses can override the following methods:
*
*
* {@link #map(String)} - map type
@@ -53,34 +44,34 @@ public abstract class Remapper {
public String mapDesc(String desc) {
Type t = Type.getType(desc);
switch (t.getSort()) {
- case Type.ARRAY:
- String s = mapDesc(t.getElementType().getDescriptor());
- for (int i = 0; i < t.getDimensions(); ++i) {
- s = '[' + s;
- }
- return s;
- case Type.OBJECT:
- String newType = map(t.getInternalName());
- if (newType != null) {
- return 'L' + newType + ';';
- }
+ case Type.ARRAY:
+ String s = mapDesc(t.getElementType().getDescriptor());
+ for (int i = 0; i < t.getDimensions(); ++i) {
+ s = '[' + s;
+ }
+ return s;
+ case Type.OBJECT:
+ String newType = map(t.getInternalName());
+ if (newType != null) {
+ return 'L' + newType + ';';
+ }
}
return desc;
}
private Type mapType(Type t) {
switch (t.getSort()) {
- case Type.ARRAY:
- String s = mapDesc(t.getElementType().getDescriptor());
- for (int i = 0; i < t.getDimensions(); ++i) {
- s = '[' + s;
- }
- return Type.getType(s);
- case Type.OBJECT:
- s = map(t.getInternalName());
- return s != null ? Type.getObjectType(s) : t;
- case Type.METHOD:
- return Type.getMethodType(mapMethodDesc(t.getDescriptor()));
+ case Type.ARRAY:
+ String s = mapDesc(t.getElementType().getDescriptor());
+ for (int i = 0; i < t.getDimensions(); ++i) {
+ s = '[' + s;
+ }
+ return Type.getType(s);
+ case Type.OBJECT:
+ s = map(t.getInternalName());
+ return s != null ? Type.getObjectType(s) : t;
+ case Type.METHOD:
+ return Type.getMethodType(mapMethodDesc(t.getDescriptor()));
}
return t;
}
@@ -137,8 +128,8 @@ public abstract class Remapper {
}
if (value instanceof Handle) {
Handle h = (Handle) value;
- return new Handle(h.getTag(), mapType(h.getOwner()), mapMethodName(
- h.getOwner(), h.getName(), h.getDesc()),
+ return new Handle(h.getTag(), mapType(h.getOwner()),
+ mapMethodName(h.getOwner(), h.getName(), h.getDesc()),
mapMethodDesc(h.getDesc()));
}
return value;
@@ -146,10 +137,8 @@ public abstract class Remapper {
/**
*
- * @param typeSignature
- * true if signature is a FieldTypeSignature, such as the
- * signature parameter of the ClassVisitor.visitField or
- * MethodVisitor.visitLocalVariable methods
+ * @param typeSignature true if signature is a FieldTypeSignature, such as the signature
+ * parameter of the ClassVisitor.visitField or MethodVisitor.visitLocalVariable methods
*/
public String mapSignature(String signature, boolean typeSignature) {
if (signature == null) {
@@ -166,20 +155,16 @@ public abstract class Remapper {
return w.toString();
}
- protected SignatureVisitor createRemappingSignatureAdapter(
- SignatureVisitor v) {
+ protected SignatureVisitor createRemappingSignatureAdapter(SignatureVisitor v) {
return new RemappingSignatureAdapter(v, this);
}
/**
* Map method name to the new name. Subclasses can override.
*
- * @param owner
- * owner of the method.
- * @param name
- * name of the method.
- * @param desc
- * descriptor of the method.
+ * @param owner owner of the method.
+ * @param name name of the method.
+ * @param desc descriptor of the method.
* @return new name of the method
*/
public String mapMethodName(String owner, String name, String desc) {
@@ -189,10 +174,8 @@ public abstract class Remapper {
/**
* Map invokedynamic method name to the new name. Subclasses can override.
*
- * @param name
- * name of the invokedynamic.
- * @param desc
- * descriptor of the invokedynamic.
+ * @param name name of the invokedynamic.
+ * @param desc descriptor of the invokedynamic.
* @return new invokdynamic name.
*/
public String mapInvokeDynamicMethodName(String name, String desc) {
@@ -202,12 +185,9 @@ public abstract class Remapper {
/**
* Map field name to the new name. Subclasses can override.
*
- * @param owner
- * owner of the field.
- * @param name
- * name of the field
- * @param desc
- * descriptor of the field
+ * @param owner owner of the field.
+ * @param name name of the field
+ * @param desc descriptor of the field
* @return new name of the field.
*/
public String mapFieldName(String owner, String name, String desc) {
diff --git a/src/main/asm/org/objectweb/asm/commons/RemappingAnnotationAdapter.java b/src/main/asm/org/objectweb/asm/commons/RemappingAnnotationAdapter.java
index 8fff2d1..f0ce9a3 100644
--- a/src/main/asm/org/objectweb/asm/commons/RemappingAnnotationAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/RemappingAnnotationAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -42,13 +34,12 @@ public class RemappingAnnotationAdapter extends AnnotationVisitor {
protected final Remapper remapper;
- public RemappingAnnotationAdapter(final AnnotationVisitor av,
- final Remapper remapper) {
+ public RemappingAnnotationAdapter(final AnnotationVisitor av, final Remapper remapper) {
this(Opcodes.ASM4, av, remapper);
}
- protected RemappingAnnotationAdapter(final int api,
- final AnnotationVisitor av, final Remapper remapper) {
+ protected RemappingAnnotationAdapter(final int api, final AnnotationVisitor av,
+ final Remapper remapper) {
super(api, av);
this.remapper = remapper;
}
@@ -66,14 +57,12 @@ public class RemappingAnnotationAdapter extends AnnotationVisitor {
@Override
public AnnotationVisitor visitAnnotation(String name, String desc) {
AnnotationVisitor v = av.visitAnnotation(name, remapper.mapDesc(desc));
- return v == null ? null : (v == av ? this
- : new RemappingAnnotationAdapter(v, remapper));
+ return v == null ? null : (v == av ? this : new RemappingAnnotationAdapter(v, remapper));
}
@Override
public AnnotationVisitor visitArray(String name) {
AnnotationVisitor v = av.visitArray(name);
- return v == null ? null : (v == av ? this
- : new RemappingAnnotationAdapter(v, remapper));
+ return v == null ? null : (v == av ? this : new RemappingAnnotationAdapter(v, remapper));
}
}
diff --git a/src/main/asm/org/objectweb/asm/commons/RemappingClassAdapter.java b/src/main/asm/org/objectweb/asm/commons/RemappingClassAdapter.java
index f9e577d..21cbcdf 100644
--- a/src/main/asm/org/objectweb/asm/commons/RemappingClassAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/RemappingClassAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -51,18 +43,17 @@ public class RemappingClassAdapter extends ClassVisitor {
this(Opcodes.ASM4, cv, remapper);
}
- protected RemappingClassAdapter(final int api, final ClassVisitor cv,
- final Remapper remapper) {
+ protected RemappingClassAdapter(final int api, final ClassVisitor cv, final Remapper remapper) {
super(api, cv);
this.remapper = remapper;
}
@Override
- public void visit(int version, int access, String name, String signature,
- String superName, String[] interfaces) {
+ public void visit(int version, int access, String name, String signature, String superName,
+ String[] interfaces) {
this.className = name;
- super.visit(version, access, remapper.mapType(name), remapper
- .mapSignature(signature, false), remapper.mapType(superName),
+ super.visit(version, access, remapper.mapType(name),
+ remapper.mapSignature(signature, false), remapper.mapType(superName),
interfaces == null ? null : remapper.mapTypes(interfaces));
}
@@ -74,39 +65,35 @@ public class RemappingClassAdapter extends ClassVisitor {
}
@Override
- public FieldVisitor visitField(int access, String name, String desc,
- String signature, Object value) {
- FieldVisitor fv = super.visitField(access,
- remapper.mapFieldName(className, name, desc),
+ public FieldVisitor visitField(int access, String name, String desc, String signature,
+ Object value) {
+ FieldVisitor fv = super.visitField(access, remapper.mapFieldName(className, name, desc),
remapper.mapDesc(desc), remapper.mapSignature(signature, true),
remapper.mapValue(value));
return fv == null ? null : createRemappingFieldAdapter(fv);
}
@Override
- public MethodVisitor visitMethod(int access, String name, String desc,
- String signature, String[] exceptions) {
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature,
+ String[] exceptions) {
String newDesc = remapper.mapMethodDesc(desc);
- MethodVisitor mv = super.visitMethod(access, remapper.mapMethodName(
- className, name, desc), newDesc, remapper.mapSignature(
- signature, false),
+ MethodVisitor mv = super.visitMethod(access, remapper.mapMethodName(className, name, desc),
+ newDesc, remapper.mapSignature(signature, false),
exceptions == null ? null : remapper.mapTypes(exceptions));
- return mv == null ? null : createRemappingMethodAdapter(access,
- newDesc, mv);
+ return mv == null ? null : createRemappingMethodAdapter(access, newDesc, mv);
}
@Override
- public void visitInnerClass(String name, String outerName,
- String innerName, int access) {
+ public void visitInnerClass(String name, String outerName, String innerName, int access) {
// TODO should innerName be changed?
- super.visitInnerClass(remapper.mapType(name), outerName == null ? null
- : remapper.mapType(outerName), innerName, access);
+ super.visitInnerClass(remapper.mapType(name),
+ outerName == null ? null : remapper.mapType(outerName), innerName, access);
}
@Override
public void visitOuterClass(String owner, String name, String desc) {
- super.visitOuterClass(remapper.mapType(owner), name == null ? null
- : remapper.mapMethodName(owner, name, desc),
+ super.visitOuterClass(remapper.mapType(owner),
+ name == null ? null : remapper.mapMethodName(owner, name, desc),
desc == null ? null : remapper.mapMethodDesc(desc));
}
@@ -114,13 +101,12 @@ public class RemappingClassAdapter extends ClassVisitor {
return new RemappingFieldAdapter(fv, remapper);
}
- protected MethodVisitor createRemappingMethodAdapter(int access,
- String newDesc, MethodVisitor mv) {
+ protected MethodVisitor createRemappingMethodAdapter(int access, String newDesc,
+ MethodVisitor mv) {
return new RemappingMethodAdapter(access, newDesc, mv, remapper);
}
- protected AnnotationVisitor createRemappingAnnotationAdapter(
- AnnotationVisitor av) {
+ protected AnnotationVisitor createRemappingAnnotationAdapter(AnnotationVisitor av) {
return new RemappingAnnotationAdapter(av, remapper);
}
}
diff --git a/src/main/asm/org/objectweb/asm/commons/RemappingFieldAdapter.java b/src/main/asm/org/objectweb/asm/commons/RemappingFieldAdapter.java
index 1dbee7e..994679d 100644
--- a/src/main/asm/org/objectweb/asm/commons/RemappingFieldAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/RemappingFieldAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -47,16 +39,14 @@ public class RemappingFieldAdapter extends FieldVisitor {
this(Opcodes.ASM4, fv, remapper);
}
- protected RemappingFieldAdapter(final int api, final FieldVisitor fv,
- final Remapper remapper) {
+ protected RemappingFieldAdapter(final int api, final FieldVisitor fv, final Remapper remapper) {
super(api, fv);
this.remapper = remapper;
}
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- AnnotationVisitor av = fv.visitAnnotation(remapper.mapDesc(desc),
- visible);
+ AnnotationVisitor av = fv.visitAnnotation(remapper.mapDesc(desc), visible);
return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}
}
diff --git a/src/main/asm/org/objectweb/asm/commons/RemappingMethodAdapter.java b/src/main/asm/org/objectweb/asm/commons/RemappingMethodAdapter.java
index e1c3b9c..c11fa68 100644
--- a/src/main/asm/org/objectweb/asm/commons/RemappingMethodAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/RemappingMethodAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -45,13 +37,13 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
protected final Remapper remapper;
- public RemappingMethodAdapter(final int access, final String desc,
- final MethodVisitor mv, final Remapper remapper) {
+ public RemappingMethodAdapter(final int access, final String desc, final MethodVisitor mv,
+ final Remapper remapper) {
this(Opcodes.ASM4, access, desc, mv, remapper);
}
- protected RemappingMethodAdapter(final int api, final int access,
- final String desc, final MethodVisitor mv, final Remapper remapper) {
+ protected RemappingMethodAdapter(final int api, final int access, final String desc,
+ final MethodVisitor mv, final Remapper remapper) {
super(api, access, desc, mv);
this.remapper = remapper;
}
@@ -64,22 +56,19 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- AnnotationVisitor av = mv.visitAnnotation(remapper.mapDesc(desc),
- visible);
+ AnnotationVisitor av = mv.visitAnnotation(remapper.mapDesc(desc), visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
}
@Override
- public AnnotationVisitor visitParameterAnnotation(int parameter,
- String desc, boolean visible) {
- AnnotationVisitor av = mv.visitParameterAnnotation(parameter,
- remapper.mapDesc(desc), visible);
+ public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
+ AnnotationVisitor av =
+ mv.visitParameterAnnotation(parameter, remapper.mapDesc(desc), visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
}
@Override
- public void visitFrame(int type, int nLocal, Object[] local, int nStack,
- Object[] stack) {
+ public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack) {
super.visitFrame(type, nLocal, remapEntries(nLocal, local), nStack,
remapEntries(nStack, stack));
}
@@ -93,8 +82,7 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
}
do {
Object t = entries[i];
- newEntries[i++] = t instanceof String ? remapper
- .mapType((String) t) : t;
+ newEntries[i++] = t instanceof String ? remapper.mapType((String) t) : t;
} while (i < n);
return newEntries;
}
@@ -103,31 +91,24 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
}
@Override
- public void visitFieldInsn(int opcode, String owner, String name,
- String desc) {
+ public void visitFieldInsn(int opcode, String owner, String name, String desc) {
super.visitFieldInsn(opcode, remapper.mapType(owner),
- remapper.mapFieldName(owner, name, desc),
- remapper.mapDesc(desc));
+ remapper.mapFieldName(owner, name, desc), remapper.mapDesc(desc));
}
@Override
- public void visitMethodInsn(int opcode, String owner, String name,
- String desc) {
+ public void visitMethodInsn(int opcode, String owner, String name, String desc) {
super.visitMethodInsn(opcode, remapper.mapType(owner),
- remapper.mapMethodName(owner, name, desc),
- remapper.mapMethodDesc(desc));
+ remapper.mapMethodName(owner, name, desc), remapper.mapMethodDesc(desc));
}
@Override
- public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
- Object... bsmArgs) {
+ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
for (int i = 0; i < bsmArgs.length; i++) {
bsmArgs[i] = remapper.mapValue(bsmArgs[i]);
}
- super.visitInvokeDynamicInsn(
- remapper.mapInvokeDynamicMethodName(name, desc),
- remapper.mapMethodDesc(desc), (Handle) remapper.mapValue(bsm),
- bsmArgs);
+ super.visitInvokeDynamicInsn(remapper.mapInvokeDynamicMethodName(name, desc),
+ remapper.mapMethodDesc(desc), (Handle) remapper.mapValue(bsm), bsmArgs);
}
@Override
@@ -146,15 +127,13 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
}
@Override
- public void visitTryCatchBlock(Label start, Label end, Label handler,
- String type) {
- super.visitTryCatchBlock(start, end, handler, type == null ? null
- : remapper.mapType(type));
+ public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
+ super.visitTryCatchBlock(start, end, handler, type == null ? null : remapper.mapType(type));
}
@Override
- public void visitLocalVariable(String name, String desc, String signature,
- Label start, Label end, int index) {
+ public void visitLocalVariable(String name, String desc, String signature, Label start,
+ Label end, int index) {
super.visitLocalVariable(name, remapper.mapDesc(desc),
remapper.mapSignature(signature, true), start, end, index);
}
diff --git a/src/main/asm/org/objectweb/asm/commons/RemappingSignatureAdapter.java b/src/main/asm/org/objectweb/asm/commons/RemappingSignatureAdapter.java
index 8550bb8..783bd7f 100644
--- a/src/main/asm/org/objectweb/asm/commons/RemappingSignatureAdapter.java
+++ b/src/main/asm/org/objectweb/asm/commons/RemappingSignatureAdapter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -46,13 +38,12 @@ public class RemappingSignatureAdapter extends SignatureVisitor {
private String className;
- public RemappingSignatureAdapter(final SignatureVisitor v,
- final Remapper remapper) {
+ public RemappingSignatureAdapter(final SignatureVisitor v, final Remapper remapper) {
this(Opcodes.ASM4, v, remapper);
}
- protected RemappingSignatureAdapter(final int api,
- final SignatureVisitor v, final Remapper remapper) {
+ protected RemappingSignatureAdapter(final int api, final SignatureVisitor v,
+ final Remapper remapper) {
super(api);
this.v = v;
this.remapper = remapper;
@@ -69,8 +60,8 @@ public class RemappingSignatureAdapter extends SignatureVisitor {
String remappedOuter = remapper.mapType(className) + '$';
className = className + '$' + name;
String remappedName = remapper.mapType(className);
- int index = remappedName.startsWith(remappedOuter) ? remappedOuter
- .length() : remappedName.lastIndexOf('$') + 1;
+ int index = remappedName.startsWith(remappedOuter) ? remappedOuter.length()
+ : remappedName.lastIndexOf('$') + 1;
v.visitInnerClassType(remappedName.substring(index));
}
diff --git a/src/main/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java b/src/main/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java
index c7caf88..17d18c3 100644
--- a/src/main/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java
+++ b/src/main/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -44,8 +36,8 @@ import java.util.Arrays;
import java.util.Collection;
/**
- * A {@link ClassVisitor} that adds a serial version unique identifier to a
- * class if missing. Here is typical usage of this class:
+ * A {@link ClassVisitor} that adds a serial version unique identifier to a class if missing. Here
+ * is typical usage of this class:
*
*
* ClassWriter cw = new ClassWriter(...);
@@ -54,8 +46,8 @@ import java.util.Collection;
* new ClassReader(orginalClass).accept(ca, false);
*
*
- * The SVUID algorithm can be found http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/class.html :
*
*
@@ -113,8 +105,7 @@ import java.util.Collection;
public class SerialVersionUIDAdder extends ClassVisitor {
/**
- * Collection of fields. (except private static and private transient
- * fields)
+ * Collection of fields. (except private static and private transient fields)
*/
private final Collection- svuidFields;
/**
@@ -151,12 +142,10 @@ public class SerialVersionUIDAdder extends ClassVisitor {
private boolean hasStaticInitializer;
/**
- * Creates a new {@link SerialVersionUIDAdder}.
Subclasses must not use
- * this constructor . Instead, they must use the
- * {@link #SerialVersionUIDAdder(int, ClassVisitor)} version.
+ * Creates a new {@link SerialVersionUIDAdder}. Subclasses must not use this constructor .
+ * Instead, they must use the {@link #SerialVersionUIDAdder(int, ClassVisitor)} version.
*
- * @param cv a {@link ClassVisitor} to which this visitor will delegate
- * calls.
+ * @param cv a {@link ClassVisitor} to which this visitor will delegate calls.
*/
public SerialVersionUIDAdder(final ClassVisitor cv) {
this(Opcodes.ASM4, cv);
@@ -165,10 +154,9 @@ public class SerialVersionUIDAdder extends ClassVisitor {
/**
* Creates a new {@link SerialVersionUIDAdder}.
*
- * @param api the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param cv a {@link ClassVisitor} to which this visitor will delegate
- * calls.
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param cv a {@link ClassVisitor} to which this visitor will delegate calls.
*/
protected SerialVersionUIDAdder(final int api, final ClassVisitor cv) {
super(api, cv);
@@ -185,31 +173,29 @@ public class SerialVersionUIDAdder extends ClassVisitor {
* Sorts the items in the collection and writes it to the data output stream
*
* @param itemCollection collection of items
- * @param dos a DataOutputStream
value
- * @param dotted a boolean
value
+ * @param dos a DataOutputStream
value
+ * @param dotted a boolean
value
* @throws IOException if an error occurs
*/
- private static void writeItems(final Collection- itemCollection,
- final DataOutput dos, final boolean dotted) throws IOException {
+ private static void writeItems(final Collection
- itemCollection, final DataOutput dos,
+ final boolean dotted) throws IOException {
int size = itemCollection.size();
Item[] items = itemCollection.toArray(new Item[size]);
Arrays.sort(items);
for (int i = 0; i < size; i++) {
dos.writeUTF(items[i].name);
dos.writeInt(items[i].access);
- dos.writeUTF(dotted ? items[i].desc.replace('/', '.')
- : items[i].desc);
+ dos.writeUTF(dotted ? items[i].desc.replace('/', '.') : items[i].desc);
}
}
/*
- * Visit class header and get class name, access , and interfaces
- * information (step 1,2, and 3) for SVUID computation.
+ * Visit class header and get class name, access , and interfaces information (step 1,2, and 3)
+ * for SVUID computation.
*/
@Override
public void visit(final int version, final int access, final String name,
- final String signature, final String superName,
- final String[] interfaces) {
+ final String signature, final String superName, final String[] interfaces) {
computeSVUID = (access & Opcodes.ACC_INTERFACE) == 0;
if (computeSVUID) {
@@ -222,27 +208,23 @@ public class SerialVersionUIDAdder extends ClassVisitor {
}
/*
- * Visit the methods and get constructor and method information (step 5 and
- * 7). Also determine if there is a class initializer (step 6).
+ * Visit the methods and get constructor and method information (step 5 and 7). Also determine
+ * if there is a class initializer (step 6).
*/
@Override
- public MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature, final String[] exceptions) {
+ public MethodVisitor visitMethod(final int access, final String name, final String desc,
+ final String signature, final String[] exceptions) {
if (computeSVUID) {
if ("
".equals(name)) {
hasStaticInitializer = true;
}
/*
- * Remembers non private constructors and methods for SVUID
- * computation For constructor and method modifiers, only the
- * ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL,
- * ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT and ACC_STRICT flags
- * are used.
+ * Remembers non private constructors and methods for SVUID computation For constructor
+ * and method modifiers, only the ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC,
+ * ACC_FINAL, ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT and ACC_STRICT flags are used.
*/
- int mods = access
- & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
- | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
- | Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED
+ int mods = access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED
+ | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED
| Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_STRICT);
// all non private methods
@@ -259,12 +241,12 @@ public class SerialVersionUIDAdder extends ClassVisitor {
}
/*
- * Gets class field information for step 4 of the algorithm. Also determines
- * if the class already has a SVUID.
+ * Gets class field information for step 4 of the algorithm. Also determines if the class
+ * already has a SVUID.
*/
@Override
- public FieldVisitor visitField(final int access, final String name,
- final String desc, final String signature, final Object value) {
+ public FieldVisitor visitField(final int access, final String name, final String desc,
+ final String signature, final Object value) {
if (computeSVUID) {
if ("serialVersionUID".equals(name)) {
// since the class already has SVUID, we won't be computing it.
@@ -272,17 +254,15 @@ public class SerialVersionUIDAdder extends ClassVisitor {
hasSVUID = true;
}
/*
- * Remember field for SVUID computation For field modifiers, only
- * the ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC,
- * ACC_FINAL, ACC_VOLATILE, and ACC_TRANSIENT flags are used when
- * computing serialVersionUID values.
+ * Remember field for SVUID computation For field modifiers, only the ACC_PUBLIC,
+ * ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ACC_VOLATILE, and ACC_TRANSIENT
+ * flags are used when computing serialVersionUID values.
*/
if ((access & Opcodes.ACC_PRIVATE) == 0
|| (access & (Opcodes.ACC_STATIC | Opcodes.ACC_TRANSIENT)) == 0) {
- int mods = access
- & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
- | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
- | Opcodes.ACC_FINAL | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT);
+ int mods = access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
+ | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL
+ | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT);
svuidFields.add(new Item(name, mods, desc));
}
}
@@ -291,15 +271,14 @@ public class SerialVersionUIDAdder extends ClassVisitor {
}
/**
- * Handle a bizarre special case. Nested classes (static classes declared
- * inside another class) that are protected have their access bit set to
- * public in their class files to deal with some odd reflection situation.
- * Our SVUID computation must do as the JVM does and ignore access bits in
- * the class file in favor of the access bits InnerClass attribute.
+ * Handle a bizarre special case. Nested classes (static classes declared inside another class)
+ * that are protected have their access bit set to public in their class files to deal with some
+ * odd reflection situation. Our SVUID computation must do as the JVM does and ignore access
+ * bits in the class file in favor of the access bits InnerClass attribute.
*/
@Override
- public void visitInnerClass(final String aname, final String outerName,
- final String innerName, final int attr_access) {
+ public void visitInnerClass(final String aname, final String outerName, final String innerName,
+ final int attr_access) {
if ((name != null) && name.equals(aname)) {
this.access = attr_access;
}
@@ -320,8 +299,7 @@ public class SerialVersionUIDAdder extends ClassVisitor {
try {
addSVUID(computeSVUID());
} catch (Throwable e) {
- throw new RuntimeException("Error while computing SVUID for "
- + name, e);
+ throw new RuntimeException("Error while computing SVUID for " + name, e);
}
}
@@ -329,8 +307,8 @@ public class SerialVersionUIDAdder extends ClassVisitor {
}
/**
- * Returns true if the class already has a SVUID field. The result of this
- * method is only valid when visitEnd is or has been called.
+ * Returns true if the class already has a SVUID field. The result of this method is only valid
+ * when visitEnd is or has been called.
*
* @return true if the class already has a SVUID field.
*/
@@ -339,8 +317,8 @@ public class SerialVersionUIDAdder extends ClassVisitor {
}
protected void addSVUID(long svuid) {
- FieldVisitor fv = super.visitField(Opcodes.ACC_FINAL
- + Opcodes.ACC_STATIC, "serialVersionUID", "J", null, svuid);
+ FieldVisitor fv = super.visitField(Opcodes.ACC_FINAL + Opcodes.ACC_STATIC,
+ "serialVersionUID", "J", null, svuid);
if (null != fv) {
fv.visitEnd();
}
@@ -369,13 +347,11 @@ public class SerialVersionUIDAdder extends ClassVisitor {
/*
* 2. The class modifiers written as a 32-bit integer.
*/
- dos.writeInt(access
- & (Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL
- | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT));
+ dos.writeInt(access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL | Opcodes.ACC_INTERFACE
+ | Opcodes.ACC_ABSTRACT));
/*
- * 3. The name of each interface sorted by name written using UTF
- * encoding.
+ * 3. The name of each interface sorted by name written using UTF encoding.
*/
Arrays.sort(interfaces);
for (String anInterface : interfaces) {
@@ -383,24 +359,22 @@ public class SerialVersionUIDAdder extends ClassVisitor {
}
/*
- * 4. For each field of the class sorted by field name (except
- * private static and private transient fields):
+ * 4. For each field of the class sorted by field name (except private static and
+ * private transient fields):
*
- * 1. The name of the field in UTF encoding. 2. The modifiers of the
- * field written as a 32-bit integer. 3. The descriptor of the field
- * in UTF encoding
+ * 1. The name of the field in UTF encoding. 2. The modifiers of the field written as a
+ * 32-bit integer. 3. The descriptor of the field in UTF encoding
*
- * Note that field signatures are not dot separated. Method and
- * constructor signatures are dot separated. Go figure...
+ * Note that field signatures are not dot separated. Method and constructor signatures
+ * are dot separated. Go figure...
*/
writeItems(svuidFields, dos, false);
/*
- * 5. If a class initializer exists, write out the following: 1. The
- * name of the method, , in UTF encoding. 2. The modifier of
- * the method, java.lang.reflect.Modifier.STATIC, written as a
- * 32-bit integer. 3. The descriptor of the method, ()V, in UTF
- * encoding.
+ * 5. If a class initializer exists, write out the following: 1. The name of the method,
+ * , in UTF encoding. 2. The modifier of the method,
+ * java.lang.reflect.Modifier.STATIC, written as a 32-bit integer. 3. The descriptor of
+ * the method, ()V, in UTF encoding.
*/
if (hasStaticInitializer) {
dos.writeUTF("");
@@ -409,42 +383,37 @@ public class SerialVersionUIDAdder extends ClassVisitor {
} // if..
/*
- * 6. For each non-private constructor sorted by method name and
- * signature: 1. The name of the method, , in UTF encoding. 2.
- * The modifiers of the method written as a 32-bit integer. 3. The
- * descriptor of the method in UTF encoding.
+ * 6. For each non-private constructor sorted by method name and signature: 1. The name
+ * of the method, , in UTF encoding. 2. The modifiers of the method written as a
+ * 32-bit integer. 3. The descriptor of the method in UTF encoding.
*/
writeItems(svuidConstructors, dos, true);
/*
- * 7. For each non-private method sorted by method name and
- * signature: 1. The name of the method in UTF encoding. 2. The
- * modifiers of the method written as a 32-bit integer. 3. The
- * descriptor of the method in UTF encoding.
+ * 7. For each non-private method sorted by method name and signature: 1. The name of
+ * the method in UTF encoding. 2. The modifiers of the method written as a 32-bit
+ * integer. 3. The descriptor of the method in UTF encoding.
*/
writeItems(svuidMethods, dos, true);
dos.flush();
/*
- * 8. The SHA-1 algorithm is executed on the stream of bytes
- * produced by DataOutputStream and produces five 32-bit values
- * sha[0..4].
+ * 8. The SHA-1 algorithm is executed on the stream of bytes produced by
+ * DataOutputStream and produces five 32-bit values sha[0..4].
*/
byte[] hashBytes = computeSHAdigest(bos.toByteArray());
/*
- * 9. The hash value is assembled from the first and second 32-bit
- * values of the SHA-1 message digest. If the result of the message
- * digest, the five 32-bit words H0 H1 H2 H3 H4, is in an array of
- * five int values named sha, the hash value would be computed as
- * follows:
+ * 9. The hash value is assembled from the first and second 32-bit values of the SHA-1
+ * message digest. If the result of the message digest, the five 32-bit words H0 H1 H2
+ * H3 H4, is in an array of five int values named sha, the hash value would be computed
+ * as follows:
*
- * long hash = ((sha[0] >>> 24) & 0xFF) | ((sha[0] >>> 16) & 0xFF)
- * << 8 | ((sha[0] >>> 8) & 0xFF) << 16 | ((sha[0] >>> 0) & 0xFF) <<
- * 24 | ((sha[1] >>> 24) & 0xFF) << 32 | ((sha[1] >>> 16) & 0xFF) <<
- * 40 | ((sha[1] >>> 8) & 0xFF) << 48 | ((sha[1] >>> 0) & 0xFF) <<
- * 56;
+ * long hash = ((sha[0] >>> 24) & 0xFF) | ((sha[0] >>> 16) & 0xFF) << 8 | ((sha[0] >>>
+ * 8) & 0xFF) << 16 | ((sha[0] >>> 0) & 0xFF) << 24 | ((sha[1] >>> 24) & 0xFF) << 32 |
+ * ((sha[1] >>> 16) & 0xFF) << 40 | ((sha[1] >>> 8) & 0xFF) << 48 | ((sha[1] >>> 0) &
+ * 0xFF) << 56;
*/
for (int i = Math.min(hashBytes.length, 8) - 1; i >= 0; i--) {
svuid = (svuid << 8) | (hashBytes[i] & 0xFF);
diff --git a/src/main/asm/org/objectweb/asm/commons/SimpleRemapper.java b/src/main/asm/org/objectweb/asm/commons/SimpleRemapper.java
index 95b43e5..6938201 100644
--- a/src/main/asm/org/objectweb/asm/commons/SimpleRemapper.java
+++ b/src/main/asm/org/objectweb/asm/commons/SimpleRemapper.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
diff --git a/src/main/asm/org/objectweb/asm/commons/StaticInitMerger.java b/src/main/asm/org/objectweb/asm/commons/StaticInitMerger.java
index 86c5ae3..f200567 100644
--- a/src/main/asm/org/objectweb/asm/commons/StaticInitMerger.java
+++ b/src/main/asm/org/objectweb/asm/commons/StaticInitMerger.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -52,23 +44,21 @@ public class StaticInitMerger extends ClassVisitor {
this(Opcodes.ASM4, prefix, cv);
}
- protected StaticInitMerger(final int api, final String prefix,
- final ClassVisitor cv) {
+ protected StaticInitMerger(final int api, final String prefix, final ClassVisitor cv) {
super(api, cv);
this.prefix = prefix;
}
@Override
public void visit(final int version, final int access, final String name,
- final String signature, final String superName,
- final String[] interfaces) {
+ final String signature, final String superName, final String[] interfaces) {
cv.visit(version, access, name, signature, superName, interfaces);
this.name = name;
}
@Override
- public MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature, final String[] exceptions) {
+ public MethodVisitor visitMethod(final int access, final String name, final String desc,
+ final String signature, final String[] exceptions) {
MethodVisitor mv;
if ("".equals(name)) {
int a = Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC;
diff --git a/src/main/asm/org/objectweb/asm/commons/TableSwitchGenerator.java b/src/main/asm/org/objectweb/asm/commons/TableSwitchGenerator.java
index 52bd316..db14b4c 100644
--- a/src/main/asm/org/objectweb/asm/commons/TableSwitchGenerator.java
+++ b/src/main/asm/org/objectweb/asm/commons/TableSwitchGenerator.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -43,10 +35,8 @@ public interface TableSwitchGenerator {
/**
* Generates the code for a switch case.
*
- * @param key
- * the switch case key.
- * @param end
- * a label that corresponds to the end of the switch statement.
+ * @param key the switch case key.
+ * @param end a label that corresponds to the end of the switch statement.
*/
void generateCase(int key, Label end);
diff --git a/src/main/asm/org/objectweb/asm/commons/TryCatchBlockSorter.java b/src/main/asm/org/objectweb/asm/commons/TryCatchBlockSorter.java
index 079c0cf..4c16549 100644
--- a/src/main/asm/org/objectweb/asm/commons/TryCatchBlockSorter.java
+++ b/src/main/asm/org/objectweb/asm/commons/TryCatchBlockSorter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -39,30 +31,27 @@ import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TryCatchBlockNode;
/**
- * A {@link MethodVisitor} adapter to sort the exception handlers. The handlers
- * are sorted in a method innermost-to-outermost. This allows the programmer to
- * add handlers without worrying about ordering them correctly with respect to
- * existing, in-code handlers.
+ * A {@link MethodVisitor} adapter to sort the exception handlers. The handlers are sorted in a
+ * method innermost-to-outermost. This allows the programmer to add handlers without worrying about
+ * ordering them correctly with respect to existing, in-code handlers.
*
- * Behavior is only defined for properly-nested handlers. If any "try" blocks
- * overlap (something that isn't possible in Java code) then this may not do
- * what you want. In fact, this adapter just sorts by the length of the "try"
- * block, taking advantage of the fact that a given try block must be larger
- * than any block it contains).
+ * Behavior is only defined for properly-nested handlers. If any "try" blocks overlap (something
+ * that isn't possible in Java code) then this may not do what you want. In fact, this adapter just
+ * sorts by the length of the "try" block, taking advantage of the fact that a given try block must
+ * be larger than any block it contains).
*
* @author Adrian Sampson
*/
public class TryCatchBlockSorter extends MethodNode {
- public TryCatchBlockSorter(final MethodVisitor mv, final int access,
- final String name, final String desc, final String signature,
- final String[] exceptions) {
+ public TryCatchBlockSorter(final MethodVisitor mv, final int access, final String name,
+ final String desc, final String signature, final String[] exceptions) {
this(Opcodes.ASM4, mv, access, name, desc, signature, exceptions);
}
- protected TryCatchBlockSorter(final int api, final MethodVisitor mv,
- final int access, final String name, final String desc,
- final String signature, final String[] exceptions) {
+ protected TryCatchBlockSorter(final int api, final MethodVisitor mv, final int access,
+ final String name, final String desc, final String signature,
+ final String[] exceptions) {
super(api, access, name, desc, signature, exceptions);
this.mv = mv;
}
diff --git a/src/main/asm/org/objectweb/asm/signature/SignatureReader.java b/src/main/asm/org/objectweb/asm/signature/SignatureReader.java
index 1083b3d..517f897 100644
--- a/src/main/asm/org/objectweb/asm/signature/SignatureReader.java
+++ b/src/main/asm/org/objectweb/asm/signature/SignatureReader.java
@@ -1,37 +1,28 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
/**
- * A type signature parser to make a signature visitor visit an existing
- * signature.
+ * A type signature parser to make a signature visitor visit an existing signature.
*
* @author Thomas Hallgren
* @author Eric Bruneton
@@ -46,28 +37,23 @@ public class SignatureReader {
/**
* Constructs a {@link SignatureReader} for the given signature.
*
- * @param signature
- * A ClassSignature , MethodTypeSignature , or
- * FieldTypeSignature .
+ * @param signature A ClassSignature , MethodTypeSignature , or
+ * FieldTypeSignature .
*/
public SignatureReader(final String signature) {
this.signature = signature;
}
/**
- * Makes the given visitor visit the signature of this
- * {@link SignatureReader}. This signature is the one specified in the
- * 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
- * ClassVisitor.visit} method) or a MethodTypeSignature (such as the
- * signature
parameter of the
- * {@link org.objectweb.asm.ClassVisitor#visitMethod
- * ClassVisitor.visitMethod} method).
+ * Makes the given visitor visit the signature of this {@link SignatureReader}. This signature
+ * is the one specified in the 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 ClassVisitor.visit} method) or a
+ * MethodTypeSignature (such as the signature
parameter of the
+ * {@link org.objectweb.asm.ClassVisitor#visitMethod ClassVisitor.visitMethod} method).
*
- * @param v
- * the visitor that must visit this signature.
+ * @param v the visitor that must visit this signature.
*/
public void accept(final SignatureVisitor v) {
String signature = this.signature;
@@ -113,18 +99,15 @@ public class SignatureReader {
}
/**
- * Makes the given visitor visit the signature of this
- * {@link SignatureReader}. This signature is the one specified in the
- * constructor (see {@link #SignatureReader(String) SignatureReader}). This
- * 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
- * MethodVisitor.visitLocalVariable} methods.
+ * Makes the given visitor visit the signature of this {@link SignatureReader}. This signature
+ * is the one specified in the constructor (see {@link #SignatureReader(String)
+ * SignatureReader}). This 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 MethodVisitor.visitLocalVariable}
+ * methods.
*
- * @param v
- * the visitor that must visit this signature.
+ * @param v the visitor that must visit this signature.
*/
public void acceptType(final SignatureVisitor v) {
parseType(this.signature, 0, v);
@@ -133,96 +116,90 @@ public class SignatureReader {
/**
* 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
- * index of the first character of the signature to parsed.
- * @param v
- * the visitor that must visit this signature.
+ * @param signature a string containing the signature that must be parsed.
+ * @param pos index of the first character of the signature to parsed.
+ * @param v the visitor that must visit this signature.
* @return the index of the first character after the parsed signature.
*/
- private static int parseType(final String signature, int pos,
- final SignatureVisitor v) {
+ private static int parseType(final String signature, int pos, final SignatureVisitor v) {
char c;
int start, end;
boolean visited, inner;
String name;
switch (c = signature.charAt(pos++)) {
- case 'Z':
- case 'C':
- case 'B':
- case 'S':
- case 'I':
- case 'F':
- case 'J':
- case 'D':
- case 'V':
- v.visitBaseType(c);
- return pos;
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ case 'F':
+ case 'J':
+ case 'D':
+ case 'V':
+ v.visitBaseType(c);
+ return pos;
- case '[':
- return parseType(signature, pos, v.visitArrayType());
+ case '[':
+ return parseType(signature, pos, v.visitArrayType());
- case 'T':
- end = signature.indexOf(';', pos);
- v.visitTypeVariable(signature.substring(pos, end));
- return end + 1;
+ case 'T':
+ end = signature.indexOf(';', pos);
+ v.visitTypeVariable(signature.substring(pos, end));
+ return end + 1;
- default: // case 'L':
- start = pos;
- visited = false;
- inner = false;
- for (;;) {
- switch (c = signature.charAt(pos++)) {
- case '.':
- case ';':
- if (!visited) {
- name = signature.substring(start, pos - 1);
- if (inner) {
- v.visitInnerClassType(name);
- } else {
- v.visitClassType(name);
- }
- }
- if (c == ';') {
- v.visitEnd();
- return pos;
- }
- start = pos;
- visited = false;
- inner = true;
- break;
-
- case '<':
- name = signature.substring(start, pos - 1);
- if (inner) {
- v.visitInnerClassType(name);
- } else {
- v.visitClassType(name);
- }
- visited = true;
- top: for (;;) {
- switch (c = signature.charAt(pos)) {
- case '>':
- break top;
- case '*':
- ++pos;
- v.visitTypeArgument();
+ default: // case 'L':
+ start = pos;
+ visited = false;
+ inner = false;
+ for (;;) {
+ switch (c = signature.charAt(pos++)) {
+ case '.':
+ case ';':
+ if (!visited) {
+ name = signature.substring(start, pos - 1);
+ if (inner) {
+ v.visitInnerClassType(name);
+ } else {
+ v.visitClassType(name);
+ }
+ }
+ if (c == ';') {
+ v.visitEnd();
+ return pos;
+ }
+ start = pos;
+ visited = false;
+ inner = true;
break;
- case '+':
- case '-':
- pos = parseType(signature, pos + 1,
- v.visitTypeArgument(c));
- break;
- default:
- pos = parseType(signature, pos,
- v.visitTypeArgument('='));
- break;
- }
+
+ case '<':
+ name = signature.substring(start, pos - 1);
+ if (inner) {
+ v.visitInnerClassType(name);
+ } else {
+ v.visitClassType(name);
+ }
+ visited = true;
+ top: for (;;) {
+ switch (c = signature.charAt(pos)) {
+ case '>':
+ break top;
+ case '*':
+ ++pos;
+ v.visitTypeArgument();
+ break;
+ case '+':
+ case '-':
+ pos = parseType(signature, pos + 1, v.visitTypeArgument(c));
+ break;
+ default:
+ pos = parseType(signature, pos, v.visitTypeArgument('='));
+ break;
+ }
+ }
}
}
- }
}
}
}
diff --git a/src/main/asm/org/objectweb/asm/signature/SignatureVisitor.java b/src/main/asm/org/objectweb/asm/signature/SignatureVisitor.java
index c0819ed..49e0765 100644
--- a/src/main/asm/org/objectweb/asm/signature/SignatureVisitor.java
+++ b/src/main/asm/org/objectweb/asm/signature/SignatureVisitor.java
@@ -1,54 +1,41 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
import org.objectweb.asm.Opcodes;
/**
- * A visitor to visit a generic signature. The methods of this interface must be
- * called in one of the three following orders (the last one is the only valid
- * order for a {@link SignatureVisitor} that is returned by a method of this
- * interface):
+ * A visitor to visit a generic signature. The methods of this interface must be called in one of
+ * the three following orders (the last one is the only valid order for a {@link SignatureVisitor}
+ * that is returned by a method of this interface):
*
- * ClassSignature = ( visitFormalTypeParameter
- * visitClassBound ? visitInterfaceBound * )* (
- * visitSuperClass visitInterface * )
- * MethodSignature = ( visitFormalTypeParameter
- * visitClassBound ? visitInterfaceBound * )* (
- * visitParameterType * visitReturnType
+ * ClassSignature = ( visitFormalTypeParameter visitClassBound ?
+ * visitInterfaceBound * )* ( visitSuperClass visitInterface * )
+ * MethodSignature = ( visitFormalTypeParameter visitClassBound ?
+ * visitInterfaceBound * )* ( visitParameterType * visitReturnType
* visitExceptionType * )
- * TypeSignature = visitBaseType |
- * visitTypeVariable | visitArrayType | (
- * visitClassType visitTypeArgument * (
- * visitInnerClassType visitTypeArgument * )* visitEnd
- * ) )
+ * TypeSignature = visitBaseType | visitTypeVariable |
+ * visitArrayType | ( visitClassType visitTypeArgument * (
+ * visitInnerClassType visitTypeArgument * )* visitEnd ) )
*
*
* @author Thomas Hallgren
@@ -72,17 +59,16 @@ public abstract class SignatureVisitor {
public final static char INSTANCEOF = '=';
/**
- * The ASM API version implemented by this visitor. The value of this field
- * must be one of {@link Opcodes#ASM4}.
+ * The ASM API version implemented by this visitor. The value of this field must be one of
+ * {@link Opcodes#ASM4}.
*/
protected final int api;
/**
* Constructs a new {@link SignatureVisitor}.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
*/
public SignatureVisitor(final int api) {
this.api = api;
@@ -91,11 +77,9 @@ public abstract class SignatureVisitor {
/**
* Visits a formal type parameter.
*
- * @param name
- * the name of the formal parameter.
+ * @param name the name of the formal parameter.
*/
- public void visitFormalTypeParameter(String name) {
- }
+ public void visitFormalTypeParameter(String name) {}
/**
* Visits the class bound of the last visited formal type parameter.
@@ -118,8 +102,7 @@ public abstract class SignatureVisitor {
/**
* Visits the type of the super class.
*
- * @return a non null visitor to visit the signature of the super class
- * type.
+ * @return a non null visitor to visit the signature of the super class type.
*/
public SignatureVisitor visitSuperclass() {
return this;
@@ -164,63 +147,49 @@ public abstract class SignatureVisitor {
/**
* Visits a signature corresponding to a primitive type.
*
- * @param descriptor
- * the descriptor of the primitive type, or 'V' for void
- * .
+ * @param descriptor the descriptor of the primitive type, or 'V' for void .
*/
- public void visitBaseType(char descriptor) {
- }
+ public void visitBaseType(char descriptor) {}
/**
* Visits a signature corresponding to a type variable.
*
- * @param name
- * the name of the type variable.
+ * @param name the name of the type variable.
*/
- public void visitTypeVariable(String name) {
- }
+ 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.
+ * @return a non null visitor to visit the signature of the array element type.
*/
public SignatureVisitor visitArrayType() {
return this;
}
/**
- * Starts the visit of a signature corresponding to a class or interface
- * type.
+ * Starts the visit of a signature corresponding to a class or interface type.
*
- * @param name
- * the internal name of the class or interface.
+ * @param name the internal name of the class or interface.
*/
- public void visitClassType(String name) {
- }
+ public void visitClassType(String name) {}
/**
* Visits an inner class.
*
- * @param name
- * the local name of the inner class in its enclosing class.
+ * @param name the local name of the inner class in its enclosing class.
*/
- public void visitInnerClassType(String name) {
- }
+ public void visitInnerClassType(String name) {}
/**
- * Visits an unbounded type argument of the last visited class or inner
- * class type.
+ * Visits an unbounded type argument of the last visited class or inner class type.
*/
- public void visitTypeArgument() {
- }
+ public void visitTypeArgument() {}
/**
* Visits a type argument of the last visited class or inner class type.
*
- * @param wildcard
- * '+', '-' or '='.
+ * @param wildcard '+', '-' or '='.
* @return a non null visitor to visit the signature of the type argument.
*/
public SignatureVisitor visitTypeArgument(char wildcard) {
@@ -230,6 +199,5 @@ public abstract class SignatureVisitor {
/**
* Ends the visit of a signature corresponding to a class or interface type.
*/
- public void visitEnd() {
- }
+ public void visitEnd() {}
}
diff --git a/src/main/asm/org/objectweb/asm/signature/SignatureWriter.java b/src/main/asm/org/objectweb/asm/signature/SignatureWriter.java
index 361b213..06cd9b0 100644
--- a/src/main/asm/org/objectweb/asm/signature/SignatureWriter.java
+++ b/src/main/asm/org/objectweb/asm/signature/SignatureWriter.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -55,10 +47,9 @@ public class SignatureWriter extends SignatureVisitor {
private boolean hasParameters;
/**
- * Stack used to keep track of class types that have arguments. Each element
- * of this stack is a boolean encoded in one bit. The top of the stack is
- * the lowest order bit. Pushing false = *2, pushing true = *2+1, popping =
- * /2.
+ * Stack used to keep track of class types that have arguments. Each element of this stack is a
+ * boolean encoded in one bit. The top of the stack is the lowest order bit. Pushing false = *2,
+ * pushing true = *2+1, popping = /2.
*/
private int argumentStack;
@@ -224,4 +215,4 @@ public class SignatureWriter extends SignatureVisitor {
}
argumentStack /= 2;
}
-}
\ No newline at end of file
+}
diff --git a/src/main/asm/org/objectweb/asm/tree/AbstractInsnNode.java b/src/main/asm/org/objectweb/asm/tree/AbstractInsnNode.java
index 1637210..423bcd1 100644
--- a/src/main/asm/org/objectweb/asm/tree/AbstractInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/AbstractInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -35,8 +27,8 @@ import java.util.Map;
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 .
+ * 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
*/
@@ -138,18 +130,16 @@ public abstract class AbstractInsnNode {
AbstractInsnNode next;
/**
- * Index of this instruction in the list to which it belongs. The value of
- * this field is correct only when {@link InsnList#cache} is not null. A
- * value of -1 indicates that this instruction does not belong to any
- * {@link InsnList}.
+ * Index of this instruction in the list to which it belongs. The value of this field is correct
+ * only when {@link InsnList#cache} is not null. A value of -1 indicates that this instruction
+ * does not belong to any {@link InsnList}.
*/
int index;
/**
* Constructs a new {@link AbstractInsnNode}.
*
- * @param opcode
- * the opcode of the instruction to be constructed.
+ * @param opcode the opcode of the instruction to be constructed.
*/
protected AbstractInsnNode(final int opcode) {
this.opcode = opcode;
@@ -168,28 +158,25 @@ public abstract class AbstractInsnNode {
/**
* Returns the type of this instruction.
*
- * @return the type of this instruction, i.e. one the constants defined in
- * this class.
+ * @return the type of this instruction, i.e. one the constants defined in this class.
*/
public abstract int getType();
/**
- * Returns the previous instruction in the list to which this instruction
- * belongs, if any.
+ * 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 .
+ * @return the previous instruction in the list to which this instruction belongs, if any. May
+ * be null .
*/
public AbstractInsnNode getPrevious() {
return prev;
}
/**
- * Returns the next instruction in the list to which this instruction
- * belongs, if any.
+ * 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 .
+ * @return the next instruction in the list to which this instruction belongs, if any. May be
+ * null .
*/
public AbstractInsnNode getNext() {
return next;
@@ -198,47 +185,38 @@ public abstract class AbstractInsnNode {
/**
* Makes the given code visitor visit this instruction.
*
- * @param cv
- * a code visitor.
+ * @param cv a code visitor.
*/
public abstract void accept(final MethodVisitor cv);
/**
* 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
- * belong to any {@link InsnList}.
+ * @param labels a map from LabelNodes to cloned LabelNodes.
+ * @return a copy of this instruction. The returned instruction does not belong to any
+ * {@link InsnList}.
*/
- public abstract AbstractInsnNode clone(
- final Map labels);
+ public abstract AbstractInsnNode clone(final Map labels);
/**
* Returns the clone of the given label.
*
- * @param label
- * a label.
- * @param map
- * a map from LabelNodes to cloned LabelNodes.
+ * @param label a label.
+ * @param map a map from LabelNodes to cloned LabelNodes.
* @return the clone of the given label.
*/
- static LabelNode clone(final LabelNode label,
- final Map map) {
+ static LabelNode clone(final LabelNode label, final Map map) {
return map.get(label);
}
/**
* Returns the clones of the given labels.
*
- * @param labels
- * a list of labels.
- * @param map
- * a map from LabelNodes to cloned LabelNodes.
+ * @param labels a list of labels.
+ * @param map a map from LabelNodes to cloned LabelNodes.
* @return the clones of the given labels.
*/
- static LabelNode[] clone(final List labels,
- final Map map) {
+ static LabelNode[] clone(final List labels, final Map map) {
LabelNode[] clones = new LabelNode[labels.size()];
for (int i = 0; i < clones.length; ++i) {
clones[i] = map.get(labels.get(i));
diff --git a/src/main/asm/org/objectweb/asm/tree/AnnotationNode.java b/src/main/asm/org/objectweb/asm/tree/AnnotationNode.java
index b37023b..dab9d7b 100644
--- a/src/main/asm/org/objectweb/asm/tree/AnnotationNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/AnnotationNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -35,247 +27,192 @@ import java.util.List;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Opcodes;
-//import cn.edu.pku.dpartner.comm.api.context.DelayLogger;
+// import cn.edu.pku.dpartner.comm.api.context.DelayLogger;
/**
* A node that represents an annotationn.
*
* @author Eric Bruneton
*/
-public class AnnotationNode extends AnnotationVisitor
-{
+public class AnnotationNode extends AnnotationVisitor {
- /**
- * The class descriptor of the annotation class.
- */
- public String desc;
+ /**
+ * The class descriptor of the annotation class.
+ */
+ public String desc;
- /**
- * The name value pairs of this annotation. Each name value pair is stored
- * 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
- * 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
- * pair.
- */
- public List values;
+ /**
+ * The name value pairs of this annotation. Each name value pair is stored 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 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 pair.
+ */
+ public List values;
- /**
- * 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.
- */
- public AnnotationNode(final String desc)
- {
- this(Opcodes.ASM4, desc);
- }
+ /**
+ * 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.
+ */
+ public AnnotationNode(final String desc) {
+ this(Opcodes.ASM4, desc);
+ }
- /**
- * Constructs a new {@link AnnotationNode}.
- *
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param desc
- * the class descriptor of the annotation class.
- */
- public AnnotationNode(final int api, final String desc)
- {
- super(api);
- this.desc = desc;
- }
+ /**
+ * Constructs a new {@link AnnotationNode}.
+ *
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param desc the class descriptor of the annotation class.
+ */
+ public AnnotationNode(final int api, final String desc) {
+ super(api);
+ this.desc = desc;
+ }
- /**
- * Constructs a new {@link AnnotationNode} to visit an array value.
- *
- * @param values
- * where the visited values must be stored.
- */
- AnnotationNode(final List values)
- {
- super(Opcodes.ASM4);
- this.values = values;
- }
+ /**
+ * Constructs a new {@link AnnotationNode} to visit an array value.
+ *
+ * @param values where the visited values must be stored.
+ */
+ AnnotationNode(final List values) {
+ super(Opcodes.ASM4);
+ this.values = values;
+ }
- // ------------------------------------------------------------------------
- // Implementation of the AnnotationVisitor abstract class
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
+ // Implementation of the AnnotationVisitor abstract class
+ // ------------------------------------------------------------------------
- @Override
- public void visit(final String name, final Object value)
- {
- if (values == null)
- {
- values = new ArrayList(this.desc != null ? 2 : 1);
- }
- if (this.desc != null)
- {
- values.add(name);
- }
- // else
- // {
- // System.out.println("[AnnotationNode] desc is null!");
- // values.add("");
- // }
- values.add(value);
- }
+ @Override
+ public void visit(final String name, final Object value) {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ // else
+ // {
+ // System.out.println("[AnnotationNode] desc is null!");
+ // values.add("");
+ // }
+ values.add(value);
+ }
- @Override
- public void visitEnum(final String name, final String desc,
- final String value)
- {
- if (values == null)
- {
- values = new ArrayList(this.desc != null ? 2 : 1);
- }
- if (this.desc != null)
- {
- values.add(name);
- }
- values.add(new String[]
- { desc, value });
- }
+ @Override
+ public void visitEnum(final String name, final String desc, final String value) {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ values.add(new String[] {desc, value});
+ }
- @Override
- public AnnotationVisitor visitAnnotation(final String name,
- final String desc)
- {
- if (values == null)
- {
- values = new ArrayList(this.desc != null ? 2 : 1);
- }
- if (this.desc != null)
- {
- values.add(name);
- }
- AnnotationNode annotation = new AnnotationNode(desc);
- values.add(annotation);
- return annotation;
- }
+ @Override
+ public AnnotationVisitor visitAnnotation(final String name, final String desc) {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ AnnotationNode annotation = new AnnotationNode(desc);
+ values.add(annotation);
+ return annotation;
+ }
- @Override
- public AnnotationVisitor visitArray(final String name)
- {
- if (values == null)
- {
- values = new ArrayList(this.desc != null ? 2 : 1);
- }
- if (this.desc != null)
- {
- values.add(name);
- }
- List array = new ArrayList();
- values.add(array);
- return new AnnotationNode(array);
- }
+ @Override
+ public AnnotationVisitor visitArray(final String name) {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ List array = new ArrayList();
+ values.add(array);
+ return new AnnotationNode(array);
+ }
- @Override
- public void visitEnd()
- {
- }
+ @Override
+ public void visitEnd() {}
- // ------------------------------------------------------------------------
- // Accept methods
- // ------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
+ // Accept methods
+ // ------------------------------------------------------------------------
- /**
- * Checks that this annotation node is compatible with the given ASM API
- * 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}.
- */
- public void check(final int api)
- {
- // nothing to do
- }
+ /**
+ * Checks that this annotation node is compatible with the given ASM API 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}.
+ */
+ public void check(final int api) {
+ // nothing to do
+ }
- /**
- * Makes the given visitor visit this annotation.
- *
- * @param av
- * an annotation visitor. Maybe null .
- */
- public void accept(final AnnotationVisitor av)
- {
- if (av != null)
- {
- if (values != null)
- {
- for (int i = 0; i < values.size(); i += 2)
- {
- if (values.get(i) == null)
- {
- System.out
- .println("[AnnotationNode] name is null!!!!!");
- // DelayLogger.logValue(values);
- System.out.flush();
- try
- {
- Thread.sleep(2000);
- }
- catch (InterruptedException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- String name = (String) values.get(i);
- Object value = values.get(i + 1);
- accept(av, name, value);
- }
- }
- av.visitEnd();
- }
- }
+ /**
+ * Makes the given visitor visit this annotation.
+ *
+ * @param av an annotation visitor. Maybe null .
+ */
+ public void accept(final AnnotationVisitor av) {
+ if (av != null) {
+ if (values != null) {
+ for (int i = 0; i < values.size(); i += 2) {
+ if (values.get(i) == null) {
+ System.out.println("[AnnotationNode] name is null!!!!!");
+ // DelayLogger.logValue(values);
+ System.out.flush();
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ String name = (String) values.get(i);
+ Object value = values.get(i + 1);
+ accept(av, name, value);
+ }
+ }
+ av.visitEnd();
+ }
+ }
- /**
- * Makes the given visitor visit a given annotation value.
- *
- * @param av
- * an annotation visitor. Maybe null .
- * @param name
- * the value name.
- * @param value
- * the actual value.
- */
- static void accept(final AnnotationVisitor av, final String name,
- final Object value)
- {
- if (av != null)
- {
- if (value instanceof String[])
- {
- String[] typeconst = (String[]) value;
- av.visitEnum(name, typeconst[0], typeconst[1]);
- }
- else if (value instanceof AnnotationNode)
- {
- AnnotationNode an = (AnnotationNode) value;
- an.accept(av.visitAnnotation(name, an.desc));
- }
- else if (value instanceof List)
- {
- AnnotationVisitor v = av.visitArray(name);
- List> array = (List>) value;
- for (int j = 0; j < array.size(); ++j)
- {
- accept(v, null, array.get(j));
- }
- v.visitEnd();
- }
- else
- {
- av.visit(name, value);
- }
- }
- }
+ /**
+ * Makes the given visitor visit a given annotation value.
+ *
+ * @param av an annotation visitor. Maybe null .
+ * @param name the value name.
+ * @param value the actual value.
+ */
+ static void accept(final AnnotationVisitor av, final String name, final Object value) {
+ if (av != null) {
+ if (value instanceof String[]) {
+ String[] typeconst = (String[]) value;
+ av.visitEnum(name, typeconst[0], typeconst[1]);
+ } else if (value instanceof AnnotationNode) {
+ AnnotationNode an = (AnnotationNode) value;
+ an.accept(av.visitAnnotation(name, an.desc));
+ } else if (value instanceof List) {
+ AnnotationVisitor v = av.visitArray(name);
+ List> array = (List>) value;
+ for (int j = 0; j < array.size(); ++j) {
+ accept(v, null, array.get(j));
+ }
+ v.visitEnd();
+ } else {
+ av.visit(name, value);
+ }
+ }
+ }
}
diff --git a/src/main/asm/org/objectweb/asm/tree/ClassNode.java b/src/main/asm/org/objectweb/asm/tree/ClassNode.java
index 11fd3bf..b2bcca0 100644
--- a/src/main/asm/org/objectweb/asm/tree/ClassNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/ClassNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -53,14 +45,14 @@ public class ClassNode extends ClassVisitor {
public int version;
/**
- * The class's access flags (see {@link org.objectweb.asm.Opcodes}). This
- * field also indicates if the class is deprecated.
+ * 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 org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * The internal name of the class (see {@link org.objectweb.asm.Type#getInternalName()
+ * getInternalName}).
*/
public String name;
@@ -70,53 +62,50 @@ public class ClassNode extends ClassVisitor {
public String signature;
/**
- * 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.
+ * 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.
*/
public String superName;
/**
* The internal names of the class's interfaces (see
- * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). This
- * list is a list of {@link String} objects.
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). This list is a list of
+ * {@link String} objects.
*/
public List interfaces;
/**
- * The name of the source file from which this class was compiled. May be
- * null .
+ * The name of the source file from which this class was compiled. May be null .
*/
public String sourceFile;
/**
- * Debug information to compute the correspondence between source and
- * compiled elements of the class. May be null .
+ * Debug information to compute the correspondence between source and compiled elements of the
+ * class. May be null .
*/
public String sourceDebug;
/**
- * The internal name of the enclosing class of the class. May be
- * null .
+ * The internal name of the enclosing class of the class. May be null .
*/
public String outerClass;
/**
- * The name of the method that contains the class, or null if the
- * class is not enclosed in a method.
+ * The name of the method that contains the class, or null if the class is not enclosed
+ * in a method.
*/
public String outerMethod;
/**
- * The descriptor of the method that contains the class, or null if
- * the class is not enclosed in a method.
+ * The descriptor of the method that contains the class, or null if the class is not
+ * enclosed in a method.
*/
public String outerMethodDesc;
/**
- * The runtime visible annotations of this class. This list is a list of
- * {@link AnnotationNode} objects. May be null .
+ * 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
* @label visible
@@ -133,41 +122,38 @@ public class ClassNode extends ClassVisitor {
public List invisibleAnnotations;
/**
- * The non standard attributes of this class. This list is a list of
- * {@link Attribute} objects. May be null .
+ * The non standard attributes of this class. This list is a list of {@link Attribute} objects.
+ * May be null .
*
* @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.
+ * Informations about the inner classes of this class. This list is a list of
+ * {@link InnerClassNode} objects.
*
* @associates org.objectweb.asm.tree.InnerClassNode
*/
public List innerClasses;
/**
- * The fields of this class. This list is a list of {@link FieldNode}
- * objects.
+ * The fields of this class. This list is a list of {@link FieldNode} objects.
*
* @associates org.objectweb.asm.tree.FieldNode
*/
public List fields;
/**
- * The methods of this class. This list is a list of {@link MethodNode}
- * objects.
+ * The methods of this class. This list is a list of {@link MethodNode} objects.
*
* @associates org.objectweb.asm.tree.MethodNode
*/
public List methods;
/**
- * Constructs a new {@link ClassNode}. Subclasses must not use this
- * constructor . Instead, they must use the {@link #ClassNode(int)}
- * version.
+ * Constructs a new {@link ClassNode}. Subclasses must not use this constructor . Instead,
+ * they must use the {@link #ClassNode(int)} version.
*/
public ClassNode() {
this(Opcodes.ASM4);
@@ -176,9 +162,8 @@ public class ClassNode extends ClassVisitor {
/**
* Constructs a new {@link ClassNode}.
*
- * @param api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
*/
public ClassNode(final int api) {
super(api);
@@ -194,8 +179,7 @@ public class ClassNode extends ClassVisitor {
@Override
public void visit(final int version, final int access, final String name,
- final String signature, final String superName,
- final String[] interfaces) {
+ final String signature, final String superName, final String[] interfaces) {
this.version = version;
this.access = access;
this.name = name;
@@ -213,16 +197,14 @@ public class ClassNode extends ClassVisitor {
}
@Override
- public void visitOuterClass(final String owner, final String name,
- final String desc) {
+ public void visitOuterClass(final String owner, final String name, final String desc) {
outerClass = owner;
outerMethod = name;
outerMethodDesc = desc;
}
@Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
+ public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
AnnotationNode an = new AnnotationNode(desc);
if (visible) {
if (visibleAnnotations == null) {
@@ -247,46 +229,41 @@ public class ClassNode extends ClassVisitor {
}
@Override
- public void visitInnerClass(final String name, final String outerName,
- final String innerName, final int access) {
- InnerClassNode icn = new InnerClassNode(name, outerName, innerName,
- access);
+ public void visitInnerClass(final String name, final String outerName, final String innerName,
+ final int access) {
+ InnerClassNode icn = new InnerClassNode(name, outerName, innerName, access);
innerClasses.add(icn);
}
@Override
- public FieldVisitor visitField(final int access, final String name,
- final String desc, final String signature, final Object value) {
+ public FieldVisitor visitField(final int access, final String name, final String desc,
+ final String signature, final Object value) {
FieldNode fn = new FieldNode(access, name, desc, signature, value);
fields.add(fn);
return fn;
}
@Override
- public MethodVisitor visitMethod(final int access, final String name,
- final String desc, final String signature, final String[] exceptions) {
- MethodNode mn = new MethodNode(access, name, desc, signature,
- exceptions);
+ public MethodVisitor visitMethod(final int access, final String name, final String desc,
+ final String signature, final String[] exceptions) {
+ MethodNode mn = new MethodNode(access, name, desc, signature, exceptions);
methods.add(mn);
return mn;
}
@Override
- public void visitEnd() {
- }
+ public void visitEnd() {}
// ------------------------------------------------------------------------
// Accept method
// ------------------------------------------------------------------------
/**
- * Checks that this class node is compatible with the given ASM API 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.
+ * Checks that this class node is compatible with the given ASM API 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}.
+ * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}.
*/
public void check(final int api) {
// nothing to do
@@ -295,8 +272,7 @@ public class ClassNode extends ClassVisitor {
/**
* Makes the given class visitor visit this class.
*
- * @param cv
- * a class visitor.
+ * @param cv a class visitor.
*/
public void accept(final ClassVisitor cv) {
// visits header
diff --git a/src/main/asm/org/objectweb/asm/tree/FieldInsnNode.java b/src/main/asm/org/objectweb/asm/tree/FieldInsnNode.java
index a827e17..91f2c9a 100644
--- a/src/main/asm/org/objectweb/asm/tree/FieldInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/FieldInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -34,8 +26,8 @@ import java.util.Map;
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.
+ * 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
*/
@@ -60,20 +52,15 @@ 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.
- * @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}).
+ * @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 org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * @param name the field's name.
+ * @param desc the field's descriptor (see {@link org.objectweb.asm.Type}).
*/
- public FieldInsnNode(final int opcode, final String owner,
- final String name, final String desc) {
+ public FieldInsnNode(final int opcode, final String owner, final String name,
+ final String desc) {
super(opcode);
this.owner = owner;
this.name = name;
@@ -83,9 +70,8 @@ public class FieldInsnNode extends AbstractInsnNode {
/**
* Sets the opcode of this instruction.
*
- * @param opcode
- * the new instruction opcode. This opcode must be GETSTATIC,
- * PUTSTATIC, GETFIELD or PUTFIELD.
+ * @param opcode the new instruction opcode. This opcode must be GETSTATIC, PUTSTATIC, GETFIELD
+ * or PUTFIELD.
*/
public void setOpcode(final int opcode) {
this.opcode = opcode;
diff --git a/src/main/asm/org/objectweb/asm/tree/FieldNode.java b/src/main/asm/org/objectweb/asm/tree/FieldNode.java
index 8f9a2cd..d872c0f 100644
--- a/src/main/asm/org/objectweb/asm/tree/FieldNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/FieldNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -46,8 +38,8 @@ import org.objectweb.asm.Opcodes;
public class FieldNode extends FieldVisitor {
/**
- * The field's access flags (see {@link org.objectweb.asm.Opcodes}). This
- * field also indicates if the field is synthetic and/or deprecated.
+ * 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;
@@ -67,15 +59,15 @@ public class FieldNode extends FieldVisitor {
public String signature;
/**
- * The field's initial value. This field, 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}.
+ * The field's initial value. This field, 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}.
*/
public Object value;
/**
- * The runtime visible annotations of this field. This list is a list of
- * {@link AnnotationNode} objects. May be null .
+ * 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
* @label visible
@@ -92,67 +84,48 @@ public class FieldNode extends FieldVisitor {
public List invisibleAnnotations;
/**
- * The non standard attributes of this field. This list is a list of
- * {@link Attribute} objects. May be null .
+ * The non standard attributes of this field. This list is a list of {@link Attribute} objects.
+ * May be null .
*
* @associates org.objectweb.asm.Attribute
*/
public List attrs;
/**
- * 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.
+ * 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 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 org.objectweb.asm.Type
- * Type}).
- * @param signature
- * the field's signature.
- * @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}.
+ * @param access the field's access flags (see {@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 org.objectweb.asm.Type Type}).
+ * @param signature the field's signature.
+ * @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}.
*/
- public FieldNode(final int access, final String name, final String desc,
- final String signature, final Object value) {
+ public FieldNode(final int access, final String name, final String desc, final String signature,
+ final Object value) {
this(Opcodes.ASM4, access, name, desc, signature, value);
}
/**
- * 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.
+ * 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 api
- * the ASM API version implemented by this visitor. Must be one
- * of {@link Opcodes#ASM4}.
- * @param access
- * the field's access flags (see
- * {@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 org.objectweb.asm.Type
- * Type}).
- * @param signature
- * the field's signature.
- * @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}.
+ * @param api the ASM API version implemented by this visitor. Must be one of
+ * {@link Opcodes#ASM4}.
+ * @param access the field's access flags (see {@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 org.objectweb.asm.Type Type}).
+ * @param signature the field's signature.
+ * @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}.
*/
- public FieldNode(final int api, final int access, final String name,
- final String desc, final String signature, final Object value) {
+ public FieldNode(final int api, final int access, final String name, final String desc,
+ final String signature, final Object value) {
super(api);
this.access = access;
this.name = name;
@@ -166,8 +139,7 @@ public class FieldNode extends FieldVisitor {
// ------------------------------------------------------------------------
@Override
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
+ public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
AnnotationNode an = new AnnotationNode(desc);
if (visible) {
if (visibleAnnotations == null) {
@@ -192,21 +164,18 @@ public class FieldNode extends FieldVisitor {
}
@Override
- public void visitEnd() {
- }
+ public void visitEnd() {}
// ------------------------------------------------------------------------
// Accept methods
// ------------------------------------------------------------------------
/**
- * Checks that this field node is compatible with the given ASM API 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.
+ * Checks that this field node is compatible with the given ASM API 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}.
+ * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}.
*/
public void check(final int api) {
// nothing to do
@@ -215,8 +184,7 @@ public class FieldNode extends FieldVisitor {
/**
* Makes the given class visitor visit this field.
*
- * @param cv
- * a class visitor.
+ * @param cv a class visitor.
*/
public void accept(final ClassVisitor cv) {
FieldVisitor fv = cv.visitField(access, name, desc, signature, value);
diff --git a/src/main/asm/org/objectweb/asm/tree/FrameNode.java b/src/main/asm/org/objectweb/asm/tree/FrameNode.java
index bd1ea70..27f65d8 100644
--- a/src/main/asm/org/objectweb/asm/tree/FrameNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/FrameNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -38,42 +30,39 @@ import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
/**
- * A node that represents a stack map frame. These nodes are pseudo instruction
- * nodes in order to be inserted in an instruction list. In fact these nodes
- * must(*) be inserted just before any instruction node i that
- * follows an unconditionnal branch instruction such as GOTO or THROW, that is
- * the target of a jump instruction, or that starts an exception handler block.
- * The stack map frame types must describe the values of the local variables and
- * of the operand stack elements just before i is executed.
+ * A node that represents a stack map frame. These nodes are pseudo instruction nodes in order to be
+ * inserted in an instruction list. In fact these nodes must(*) be inserted just before any
+ * instruction node i that follows an unconditionnal branch instruction such as GOTO or
+ * THROW, that is the target of a jump instruction, or that starts an exception handler block. The
+ * stack map frame 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}.
+ * (*) 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 {
/**
- * The type of this 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.
+ * The type of this 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.
*/
public int type;
/**
- * The types of the local variables of this stack map frame. Elements of
- * this list can be Integer, String or LabelNode objects (for primitive,
- * reference and uninitialized types respectively - see
- * {@link MethodVisitor}).
+ * The types of the local variables of this stack map frame. Elements of this list can be
+ * Integer, String or LabelNode objects (for primitive, reference and uninitialized types
+ * respectively - see {@link MethodVisitor}).
*/
public List local;
/**
- * The types of the operand stack elements of this stack map frame. Elements
- * of this list can be Integer, String or LabelNode objects (for primitive,
- * reference and uninitialized types respectively - see
- * {@link MethodVisitor}).
+ * The types of the operand stack elements of this stack map frame. Elements of this list can be
+ * Integer, String or LabelNode objects (for primitive, reference and uninitialized types
+ * respectively - see {@link MethodVisitor}).
*/
public List stack;
@@ -84,48 +73,40 @@ public class FrameNode extends AbstractInsnNode {
/**
* 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},
- * {@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
- * number of local variables of this stack map frame.
- * @param local
- * the types of the local variables of this stack map frame.
- * Elements of this list can be Integer, String or LabelNode
- * objects (for primitive, reference and uninitialized types
- * respectively - see {@link MethodVisitor}).
- * @param nStack
- * number of operand stack elements of this stack map frame.
- * @param stack
- * the types of the operand stack elements of this stack map
- * frame. Elements of this list can be Integer, String or
- * LabelNode objects (for primitive, reference and uninitialized
- * types respectively - see {@link MethodVisitor}).
+ * @param type the type of this 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 number of local variables of this stack map frame.
+ * @param local the types of the local variables of this stack map frame. Elements of this list
+ * can be Integer, String or LabelNode objects (for primitive, reference and
+ * uninitialized types respectively - see {@link MethodVisitor}).
+ * @param nStack number of operand stack elements of this stack map frame.
+ * @param stack the types of the operand stack elements of this stack map frame. Elements of
+ * this list can be Integer, String or LabelNode objects (for primitive, reference and
+ * uninitialized types respectively - see {@link MethodVisitor}).
*/
- public FrameNode(final int type, final int nLocal, final Object[] local,
- final int nStack, final Object[] stack) {
+ public FrameNode(final int type, final int nLocal, final Object[] local, final int nStack,
+ final Object[] stack) {
super(-1);
this.type = type;
switch (type) {
- case Opcodes.F_NEW:
- case Opcodes.F_FULL:
- this.local = asList(nLocal, local);
- this.stack = asList(nStack, stack);
- break;
- case Opcodes.F_APPEND:
- this.local = asList(nLocal, local);
- break;
- case Opcodes.F_CHOP:
- this.local = Arrays.asList(new Object[nLocal]);
- break;
- case Opcodes.F_SAME:
- break;
- case Opcodes.F_SAME1:
- this.stack = asList(1, stack);
- break;
+ case Opcodes.F_NEW:
+ case Opcodes.F_FULL:
+ this.local = asList(nLocal, local);
+ this.stack = asList(nStack, stack);
+ break;
+ case Opcodes.F_APPEND:
+ this.local = asList(nLocal, local);
+ break;
+ case Opcodes.F_CHOP:
+ this.local = Arrays.asList(new Object[nLocal]);
+ break;
+ case Opcodes.F_SAME:
+ break;
+ case Opcodes.F_SAME1:
+ this.stack = asList(1, stack);
+ break;
}
}
@@ -137,29 +118,27 @@ public class FrameNode extends AbstractInsnNode {
/**
* Makes the given visitor visit this stack map frame.
*
- * @param mv
- * a method visitor.
+ * @param mv a method visitor.
*/
@Override
public void accept(final MethodVisitor mv) {
switch (type) {
- case Opcodes.F_NEW:
- case Opcodes.F_FULL:
- mv.visitFrame(type, local.size(), asArray(local), stack.size(),
- asArray(stack));
- break;
- case Opcodes.F_APPEND:
- mv.visitFrame(type, local.size(), asArray(local), 0, null);
- break;
- case Opcodes.F_CHOP:
- mv.visitFrame(type, local.size(), null, 0, null);
- break;
- case Opcodes.F_SAME:
- mv.visitFrame(type, 0, null, 0, null);
- break;
- case Opcodes.F_SAME1:
- mv.visitFrame(type, 0, null, 1, asArray(stack));
- break;
+ case Opcodes.F_NEW:
+ case Opcodes.F_FULL:
+ mv.visitFrame(type, local.size(), asArray(local), stack.size(), asArray(stack));
+ break;
+ case Opcodes.F_APPEND:
+ mv.visitFrame(type, local.size(), asArray(local), 0, null);
+ break;
+ case Opcodes.F_CHOP:
+ mv.visitFrame(type, local.size(), null, 0, null);
+ break;
+ case Opcodes.F_SAME:
+ mv.visitFrame(type, 0, null, 0, null);
+ break;
+ case Opcodes.F_SAME1:
+ mv.visitFrame(type, 0, null, 1, asArray(stack));
+ break;
}
}
diff --git a/src/main/asm/org/objectweb/asm/tree/IincInsnNode.java b/src/main/asm/org/objectweb/asm/tree/IincInsnNode.java
index 179ec6e..a488944 100644
--- a/src/main/asm/org/objectweb/asm/tree/IincInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/IincInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -54,10 +46,8 @@ public class IincInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link IincInsnNode}.
*
- * @param var
- * index of the local variable to be incremented.
- * @param incr
- * increment amount to increment the local variable by.
+ * @param var index of the local variable to be incremented.
+ * @param incr increment amount to increment the local variable by.
*/
public IincInsnNode(final int var, final int incr) {
super(Opcodes.IINC);
@@ -79,4 +69,4 @@ public class IincInsnNode extends AbstractInsnNode {
public AbstractInsnNode clone(final Map labels) {
return new IincInsnNode(var, incr);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/asm/org/objectweb/asm/tree/InnerClassNode.java b/src/main/asm/org/objectweb/asm/tree/InnerClassNode.java
index 5198cfb..335fcb2 100644
--- a/src/main/asm/org/objectweb/asm/tree/InnerClassNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/InnerClassNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -39,50 +31,43 @@ import org.objectweb.asm.ClassVisitor;
public class InnerClassNode {
/**
- * The internal name of an inner class (see
- * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * The internal name of an inner class (see {@link org.objectweb.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
- * null .
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). May be null .
*/
public String outerName;
/**
- * The (simple) name of the inner class inside its enclosing class. May be
- * null for anonymous inner classes.
+ * The (simple) name of the inner class inside its enclosing class. May be null for
+ * anonymous inner classes.
*/
public String innerName;
/**
- * The access flags of the inner class as originally declared in the
- * enclosing class.
+ * The access flags of the inner class as originally declared in the enclosing class.
*/
public int access;
/**
* Constructs a new {@link InnerClassNode}.
*
- * @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 .
- * @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.
+ * @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 .
+ * @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 InnerClassNode(final String name, final String outerName,
- final String innerName, final int access) {
+ public InnerClassNode(final String name, final String outerName, final String innerName,
+ final int access) {
this.name = name;
this.outerName = outerName;
this.innerName = innerName;
@@ -92,8 +77,7 @@ public class InnerClassNode {
/**
* Makes the given class visitor visit this inner class.
*
- * @param cv
- * a class visitor.
+ * @param cv a class visitor.
*/
public void accept(final ClassVisitor cv) {
cv.visitInnerClass(name, outerName, innerName, access);
diff --git a/src/main/asm/org/objectweb/asm/tree/InsnList.java b/src/main/asm/org/objectweb/asm/tree/InsnList.java
index e3630c5..7c71858 100644
--- a/src/main/asm/org/objectweb/asm/tree/InsnList.java
+++ b/src/main/asm/org/objectweb/asm/tree/InsnList.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -35,8 +27,8 @@ import java.util.NoSuchElementException;
import org.objectweb.asm.MethodVisitor;
/**
- * A doubly linked list of {@link AbstractInsnNode} objects. This
- * implementation is not thread safe .
+ * A doubly linked list of {@link AbstractInsnNode} objects. This implementation is not thread
+ * safe .
*/
public class InsnList {
@@ -56,8 +48,8 @@ public class InsnList {
private AbstractInsnNode last;
/**
- * A cache of the instructions of this list. This cache is used to improve
- * the performance of the {@link #get} method.
+ * A cache of the instructions of this list. This cache is used to improve the performance of
+ * the {@link #get} method.
*/
AbstractInsnNode[] cache;
@@ -73,8 +65,7 @@ public class InsnList {
/**
* Returns the first instruction in this list.
*
- * @return the first instruction in this list, or null if the list
- * is empty.
+ * @return the first instruction in this list, or null if the list is empty.
*/
public AbstractInsnNode getFirst() {
return first;
@@ -83,24 +74,21 @@ public class InsnList {
/**
* Returns the last instruction in this list.
*
- * @return the last instruction in this list, or null if the list
- * is empty.
+ * @return the last instruction in this list, or null if the list is empty.
*/
public AbstractInsnNode getLast() {
return last;
}
/**
- * Returns the instruction whose index is given. This method builds a cache
- * 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.
+ * Returns the instruction whose index is given. This method builds a cache 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.
+ * @param index the index of the instruction that must be returned.
* @return the instruction whose index is given.
- * @throws IndexOutOfBoundsException
- * if (index < 0 || index >= size()).
+ * @throws IndexOutOfBoundsException if (index < 0 || index >= size()).
*/
public AbstractInsnNode get(final int index) {
if (index < 0 || index >= size) {
@@ -113,12 +101,11 @@ public class InsnList {
}
/**
- * 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.
+ * 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.
+ * @param insn an instruction.
* @return true if the given instruction belongs to this list.
*/
public boolean contains(final AbstractInsnNode insn) {
@@ -130,18 +117,16 @@ public class InsnList {
}
/**
- * Returns the index of the given instruction in this list. This method
- * builds a cache of the instruction indexes to avoid scanning the whole
- * 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.
+ * Returns the index of the given instruction in this list. This method builds a cache of the
+ * instruction indexes to avoid scanning the whole 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
- * this method is undefined if the given instruction does not belong
- * to this list . Use {@link #contains contains} to test if an
- * instruction belongs to an instruction list or not.
+ * @param insn an instruction of this list .
+ * @return the index of the given instruction in this list. The result of this method is
+ * undefined if the given instruction does not belong to this list . Use
+ * {@link #contains contains} to test if an instruction belongs to an instruction list
+ * or not.
*/
public int indexOf(final AbstractInsnNode insn) {
if (cache == null) {
@@ -153,8 +138,7 @@ public class InsnList {
/**
* Makes the given visitor visit all of the instructions in this list.
*
- * @param mv
- * the method visitor that must visit the instructions.
+ * @param mv the method visitor that must visit the instructions.
*/
public void accept(final MethodVisitor mv) {
AbstractInsnNode insn = first;
@@ -203,11 +187,8 @@ public class InsnList {
/**
* Replaces an instruction of this list with another instruction.
*
- * @param location
- * an instruction of this list .
- * @param insn
- * another instruction, which must not belong to any
- * {@link InsnList} .
+ * @param location an instruction of this list .
+ * @param insn another instruction, which must not belong to any {@link InsnList} .
*/
public void set(final AbstractInsnNode location, final AbstractInsnNode insn) {
AbstractInsnNode next = location.next;
@@ -239,9 +220,7 @@ public class InsnList {
/**
* Adds the given instruction to the end of this list.
*
- * @param insn
- * an instruction, which must not belong to any
- * {@link InsnList} .
+ * @param insn an instruction, which must not belong to any {@link InsnList} .
*/
public void add(final AbstractInsnNode insn) {
++size;
@@ -260,9 +239,8 @@ public class InsnList {
/**
* 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'.
+ * @param insns an instruction list, which is cleared during the process. This list must be
+ * different from 'this'.
*/
public void add(final InsnList insns) {
if (insns.size == 0) {
@@ -285,9 +263,7 @@ public class InsnList {
/**
* Inserts the given instruction at the begining of this list.
*
- * @param insn
- * an instruction, which must not belong to any
- * {@link InsnList} .
+ * @param insn an instruction, which must not belong to any {@link InsnList} .
*/
public void insert(final AbstractInsnNode insn) {
++size;
@@ -306,9 +282,8 @@ public class InsnList {
/**
* 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'.
+ * @param insns an instruction list, which is cleared during the process. This list must be
+ * different from 'this'.
*/
public void insert(final InsnList insns) {
if (insns.size == 0) {
@@ -331,15 +306,11 @@ public class InsnList {
/**
* Inserts the given instruction after the specified instruction.
*
- * @param location
- * an instruction of this list after which insn must be
- * inserted.
- * @param insn
- * the instruction to be inserted, which must not belong to
- * any {@link InsnList} .
+ * @param location an instruction of this list after which insn must be inserted.
+ * @param insn the instruction to be inserted, which must not belong to any
+ * {@link InsnList} .
*/
- public void insert(final AbstractInsnNode location,
- final AbstractInsnNode insn) {
+ public void insert(final AbstractInsnNode location, final AbstractInsnNode insn) {
++size;
AbstractInsnNode next = location.next;
if (next == null) {
@@ -357,12 +328,10 @@ public class InsnList {
/**
* Inserts the given instructions after the specified instruction.
*
- * @param location
- * an instruction of this list after which the
- * instructions must be inserted.
- * @param insns
- * the instruction list to be inserted, which is cleared during
- * the process. This list must be different from 'this'.
+ * @param location an instruction of this list after which the instructions must be
+ * inserted.
+ * @param insns the instruction list to be inserted, which is cleared during the process. This
+ * list must be different from 'this'.
*/
public void insert(final AbstractInsnNode location, final InsnList insns) {
if (insns.size == 0) {
@@ -387,15 +356,11 @@ public class InsnList {
/**
* Inserts the given instruction before the specified instruction.
*
- * @param location
- * an instruction of this list before which insn must be
- * inserted.
- * @param insn
- * the instruction to be inserted, which must not belong to
- * any {@link InsnList} .
+ * @param location an instruction of this list before which insn must be inserted.
+ * @param insn the instruction to be inserted, which must not belong to any
+ * {@link InsnList} .
*/
- public void insertBefore(final AbstractInsnNode location,
- final AbstractInsnNode insn) {
+ public void insertBefore(final AbstractInsnNode location, final AbstractInsnNode insn) {
++size;
AbstractInsnNode prev = location.prev;
if (prev == null) {
@@ -413,15 +378,12 @@ public class InsnList {
/**
* Inserts the given instructions before the specified instruction.
*
- * @param location
- * an instruction of this list before which the
- * instructions must be inserted.
- * @param insns
- * the instruction list to be inserted, which is cleared during
- * the process. This list must be different from 'this'.
+ * @param location an instruction of this list before which the instructions must be
+ * inserted.
+ * @param insns the instruction list to be inserted, which is cleared during the process. This
+ * list must be different from 'this'.
*/
- public void insertBefore(final AbstractInsnNode location,
- final InsnList insns) {
+ public void insertBefore(final AbstractInsnNode location, final InsnList insns) {
if (insns.size == 0) {
return;
}
@@ -444,8 +406,7 @@ public class InsnList {
/**
* Removes the given instruction from this list.
*
- * @param insn
- * the instruction of this list that must be removed.
+ * @param insn the instruction of this list that must be removed.
*/
public void remove(final AbstractInsnNode insn) {
--size;
@@ -477,9 +438,8 @@ public class InsnList {
/**
* Removes all of the instructions of this list.
*
- * @param mark
- * if the instructions must be marked as no longer belonging to
- * any {@link InsnList}.
+ * @param mark if the instructions must be marked as no longer belonging to any
+ * {@link InsnList}.
*/
void removeAll(final boolean mark) {
if (mark) {
@@ -506,9 +466,8 @@ public class InsnList {
}
/**
- * Reset all labels in the instruction list. This method should be called
- * before reusing same instructions list between several
- * ClassWriter
s.
+ * Reset all labels in the instruction list. This method should be called before reusing same
+ * instructions list between several ClassWriter
s.
*/
public void resetLabels() {
AbstractInsnNode insn = first;
diff --git a/src/main/asm/org/objectweb/asm/tree/InsnNode.java b/src/main/asm/org/objectweb/asm/tree/InsnNode.java
index 7221098..8c547c6 100644
--- a/src/main/asm/org/objectweb/asm/tree/InsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/InsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -43,22 +35,17 @@ 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,
- * 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.
+ * @param opcode the opcode of the instruction to be constructed. This opcode must be 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 InsnNode(final int opcode) {
super(opcode);
@@ -72,8 +59,7 @@ public class InsnNode extends AbstractInsnNode {
/**
* Makes the given visitor visit this instruction.
*
- * @param mv
- * a method visitor.
+ * @param mv a method visitor.
*/
@Override
public void accept(final MethodVisitor mv) {
diff --git a/src/main/asm/org/objectweb/asm/tree/IntInsnNode.java b/src/main/asm/org/objectweb/asm/tree/IntInsnNode.java
index 9fa80df..9d58df8 100644
--- a/src/main/asm/org/objectweb/asm/tree/IntInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/IntInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -48,11 +40,9 @@ 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.
- * @param operand
- * the operand of the instruction to be constructed.
+ * @param opcode the opcode of the instruction to be constructed. This opcode must be BIPUSH,
+ * SIPUSH or NEWARRAY.
+ * @param operand the operand of the instruction to be constructed.
*/
public IntInsnNode(final int opcode, final int operand) {
super(opcode);
@@ -62,9 +52,7 @@ public class IntInsnNode extends AbstractInsnNode {
/**
* Sets the opcode of this instruction.
*
- * @param opcode
- * the new instruction opcode. This opcode must be BIPUSH, SIPUSH
- * or NEWARRAY.
+ * @param opcode the new instruction opcode. This opcode must be BIPUSH, SIPUSH or NEWARRAY.
*/
public void setOpcode(final int opcode) {
this.opcode = opcode;
diff --git a/src/main/asm/org/objectweb/asm/tree/InvokeDynamicInsnNode.java b/src/main/asm/org/objectweb/asm/tree/InvokeDynamicInsnNode.java
index 2ae1d97..2f6bb10 100644
--- a/src/main/asm/org/objectweb/asm/tree/InvokeDynamicInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/InvokeDynamicInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -65,17 +57,13 @@ public class InvokeDynamicInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link InvokeDynamicInsnNode}.
*
- * @param name
- * invokedynamic name.
- * @param desc
- * invokedynamic descriptor (see {@link org.objectweb.asm.Type}).
- * @param bsm
- * the bootstrap method.
- * @param bsmArgs
- * the boostrap constant arguments.
+ * @param name invokedynamic name.
+ * @param desc invokedynamic descriptor (see {@link org.objectweb.asm.Type}).
+ * @param bsm the bootstrap method.
+ * @param bsmArgs the boostrap constant arguments.
*/
- public InvokeDynamicInsnNode(final String name, final String desc,
- final Handle bsm, final Object... bsmArgs) {
+ public InvokeDynamicInsnNode(final String name, final String desc, final Handle bsm,
+ final Object... bsmArgs) {
super(Opcodes.INVOKEDYNAMIC);
this.name = name;
this.desc = desc;
@@ -97,4 +85,4 @@ public class InvokeDynamicInsnNode extends AbstractInsnNode {
public AbstractInsnNode clone(final Map labels) {
return new InvokeDynamicInsnNode(name, desc, bsm, bsmArgs);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/asm/org/objectweb/asm/tree/JumpInsnNode.java b/src/main/asm/org/objectweb/asm/tree/JumpInsnNode.java
index 9cb1dcb..7d66bc7 100644
--- a/src/main/asm/org/objectweb/asm/tree/JumpInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/JumpInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -34,31 +26,27 @@ import java.util.Map;
import org.objectweb.asm.MethodVisitor;
/**
- * A node that represents a jump instruction. A jump instruction is an
- * instruction that may jump to another instruction.
+ * 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 {
/**
- * The operand of this instruction. This operand is a label that designates
- * the instruction to which this instruction may jump.
+ * The operand of this instruction. This operand is a label that designates the instruction to
+ * which this instruction may jump.
*/
public LabelNode label;
/**
* 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,
- * 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 constructed. This operand
- * is a label that designates the instruction to which the jump
- * instruction may jump.
+ * @param opcode the opcode of the type instruction to be constructed. This opcode must be 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 constructed. This operand is a label that
+ * designates the instruction to which the jump instruction may jump.
*/
public JumpInsnNode(final int opcode, final LabelNode label) {
super(opcode);
@@ -68,11 +56,9 @@ public class JumpInsnNode extends AbstractInsnNode {
/**
* 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,
- * IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO,
- * JSR, IFNULL or IFNONNULL.
+ * @param opcode the new instruction opcode. This opcode must be 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.
*/
public void setOpcode(final int opcode) {
this.opcode = opcode;
diff --git a/src/main/asm/org/objectweb/asm/tree/LabelNode.java b/src/main/asm/org/objectweb/asm/tree/LabelNode.java
index b6381bd..3d6f8d5 100644
--- a/src/main/asm/org/objectweb/asm/tree/LabelNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/LabelNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -75,4 +67,4 @@ public class LabelNode extends AbstractInsnNode {
public void resetLabel() {
label = null;
}
-}
\ No newline at end of file
+}
diff --git a/src/main/asm/org/objectweb/asm/tree/LdcInsnNode.java b/src/main/asm/org/objectweb/asm/tree/LdcInsnNode.java
index 9209f46..b42a54a 100644
--- a/src/main/asm/org/objectweb/asm/tree/LdcInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/LdcInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -42,19 +34,18 @@ import org.objectweb.asm.Opcodes;
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}.
+ * 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}.
*/
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
- * {@link Double} or a {@link String}.
+ * @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} or a
+ * {@link String}.
*/
public LdcInsnNode(final Object cst) {
super(Opcodes.LDC);
@@ -75,4 +66,4 @@ public class LdcInsnNode extends AbstractInsnNode {
public AbstractInsnNode clone(final Map labels) {
return new LdcInsnNode(cst);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/asm/org/objectweb/asm/tree/LineNumberNode.java b/src/main/asm/org/objectweb/asm/tree/LineNumberNode.java
index cda1694..5aa9ac7 100644
--- a/src/main/asm/org/objectweb/asm/tree/LineNumberNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/LineNumberNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -34,16 +26,15 @@ import java.util.Map;
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.
+ * 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 {
/**
- * A line number. This number refers to the source file from which the class
- * was compiled.
+ * A line number. This number refers to the source file from which the class was compiled.
*/
public int line;
@@ -55,11 +46,9 @@ 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.
- * @param start
- * the first instruction corresponding to this line number.
+ * @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.
*/
public LineNumberNode(final int line, final LabelNode start) {
super(-1);
diff --git a/src/main/asm/org/objectweb/asm/tree/LocalVariableNode.java b/src/main/asm/org/objectweb/asm/tree/LocalVariableNode.java
index 033f83e..427be1e 100644
--- a/src/main/asm/org/objectweb/asm/tree/LocalVariableNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/LocalVariableNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -54,14 +46,12 @@ public class LocalVariableNode {
public String signature;
/**
- * The first instruction corresponding to the scope of this local variable
- * (inclusive).
+ * The first instruction corresponding to the scope of this local variable (inclusive).
*/
public LabelNode start;
/**
- * The last instruction corresponding to the scope of this local variable
- * (exclusive).
+ * The last instruction corresponding to the scope of this local variable (exclusive).
*/
public LabelNode end;
@@ -73,24 +63,17 @@ public class LocalVariableNode {
/**
* Constructs a new {@link LocalVariableNode}.
*
- * @param name
- * the name of a local variable.
- * @param desc
- * the type descriptor of this local variable.
- * @param signature
- * the signature of this local variable. May be null .
- * @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.
+ * @param name the name of a local variable.
+ * @param desc the type descriptor of this local variable.
+ * @param signature the signature of this local variable. May be null .
+ * @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.
*/
- public LocalVariableNode(final String name, final String desc,
- final String signature, final LabelNode start, final LabelNode end,
- final int index) {
+ public LocalVariableNode(final String name, final String desc, final String signature,
+ final LabelNode start, final LabelNode end, final int index) {
this.name = name;
this.desc = desc;
this.signature = signature;
@@ -102,11 +85,9 @@ public class LocalVariableNode {
/**
* Makes the given visitor visit this local variable declaration.
*
- * @param mv
- * a method visitor.
+ * @param mv a method visitor.
*/
public void accept(final MethodVisitor mv) {
- mv.visitLocalVariable(name, desc, signature, start.getLabel(),
- end.getLabel(), index);
+ mv.visitLocalVariable(name, desc, signature, start.getLabel(), end.getLabel(), index);
}
}
diff --git a/src/main/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java b/src/main/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java
index c44c5ef..4a71255 100644
--- a/src/main/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -56,29 +48,23 @@ public class LookupSwitchInsnNode extends AbstractInsnNode {
public List keys;
/**
- * Beginnings of the handler blocks. This list is a list of
- * {@link LabelNode} objects.
+ * Beginnings of the handler blocks. This list is a list of {@link LabelNode} objects.
*/
public List labels;
/**
* Constructs a new {@link LookupSwitchInsnNode}.
*
- * @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.
+ * @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 LookupSwitchInsnNode(final LabelNode dflt, final int[] keys,
- final LabelNode[] labels) {
+ public LookupSwitchInsnNode(final LabelNode dflt, final int[] keys, final LabelNode[] labels) {
super(Opcodes.LOOKUPSWITCH);
this.dflt = dflt;
this.keys = new ArrayList(keys == null ? 0 : keys.length);
- this.labels = new ArrayList(labels == null ? 0
- : labels.length);
+ this.labels = new ArrayList(labels == null ? 0 : labels.length);
if (keys != null) {
for (int i = 0; i < keys.length; ++i) {
this.keys.add(new Integer(keys[i]));
@@ -109,8 +95,8 @@ public class LookupSwitchInsnNode extends AbstractInsnNode {
@Override
public AbstractInsnNode clone(final Map labels) {
- LookupSwitchInsnNode clone = new LookupSwitchInsnNode(clone(dflt,
- labels), null, clone(this.labels, labels));
+ LookupSwitchInsnNode clone =
+ new LookupSwitchInsnNode(clone(dflt, labels), null, clone(this.labels, labels));
clone.keys.addAll(keys);
return clone;
}
diff --git a/src/main/asm/org/objectweb/asm/tree/MethodInsnNode.java b/src/main/asm/org/objectweb/asm/tree/MethodInsnNode.java
index bd3d4a6..6d93e74 100644
--- a/src/main/asm/org/objectweb/asm/tree/MethodInsnNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/MethodInsnNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -34,8 +26,8 @@ import java.util.Map;
import org.objectweb.asm.MethodVisitor;
/**
- * A node that represents a method instruction. A method instruction is an
- * instruction that invokes a method.
+ * A node that represents a method instruction. A method instruction is an instruction that invokes
+ * a method.
*
* @author Eric Bruneton
*/
@@ -60,21 +52,15 @@ 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 org.objectweb.asm.Type#getInternalName()
- * getInternalName}).
- * @param name
- * the method's name.
- * @param desc
- * the method's descriptor (see {@link org.objectweb.asm.Type}).
+ * @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 org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link org.objectweb.asm.Type}).
*/
- public MethodInsnNode(final int opcode, final String owner,
- final String name, final String desc) {
+ public MethodInsnNode(final int opcode, final String owner, final String name,
+ final String desc) {
super(opcode);
this.owner = owner;
this.name = name;
@@ -84,9 +70,8 @@ public class MethodInsnNode extends AbstractInsnNode {
/**
* Sets the opcode of this instruction.
*
- * @param opcode
- * the new instruction opcode. This opcode must be INVOKEVIRTUAL,
- * INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
+ * @param opcode the new instruction opcode. This opcode must be INVOKEVIRTUAL, INVOKESPECIAL,
+ * INVOKESTATIC or INVOKEINTERFACE.
*/
public void setOpcode(final int opcode) {
this.opcode = opcode;
@@ -106,4 +91,4 @@ public class MethodInsnNode extends AbstractInsnNode {
public AbstractInsnNode clone(final Map labels) {
return new MethodInsnNode(opcode, owner, name, desc);
}
-}
\ No newline at end of file
+}
diff --git a/src/main/asm/org/objectweb/asm/tree/MethodNode.java b/src/main/asm/org/objectweb/asm/tree/MethodNode.java
index bf380cf..d82f9c9 100644
--- a/src/main/asm/org/objectweb/asm/tree/MethodNode.java
+++ b/src/main/asm/org/objectweb/asm/tree/MethodNode.java
@@ -1,31 +1,23 @@
/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2011 INRIA, France Telecom
- * All rights reserved.
+ * ASM: a very small and fast Java bytecode manipulation framework Copyright (c) 2000-2011 INRIA,
+ * France Telecom All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: 1. Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions
+ * in binary form must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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;
@@ -50,8 +42,8 @@ import org.objectweb.asm.Type;
public class MethodNode extends MethodVisitor {
/**
- * The method's access flags (see {@link Opcodes}). This field also
- * indicates if the method is synthetic and/or deprecated.
+ * The method's access flags (see {@link Opcodes}). This field also indicates if the method is
+ * synthetic and/or deprecated.
*/
public int access;
@@ -71,15 +63,14 @@ public class MethodNode extends MethodVisitor {
public String signature;
/**
- * The internal names of the method's exception classes (see
- * {@link Type#getInternalName() getInternalName}). This list is a list of
- * {@link String} objects.
+ * The internal names of the method's exception classes (see {@link Type#getInternalName()
+ * getInternalName}). This list is a list of {@link String} objects.
*/
public List exceptions;
/**
- * The runtime visible annotations of this method. This list is a list of
- * {@link AnnotationNode} objects. May be null .
+ * 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
* @label visible
@@ -96,26 +87,25 @@ public class MethodNode extends MethodVisitor {
public List invisibleAnnotations;
/**
- * The non standard attributes of this method. This list is a list of
- * {@link Attribute} objects. May be null .
+ * The non standard attributes of this method. This list is a list of {@link Attribute} objects.
+ * May be null .
*
* @associates org.objectweb.asm.Attribute
*/
public List attrs;
/**
- * The default value of this annotation interface method. This field must be
- * a {@link Byte}, {@link Boolean}, {@link Character}, {@link Short},
- * {@link Integer}, {@link Long}, {@link Float}, {@link Double},
- * {@link String} or {@link 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. May be null .
+ * The default value of this annotation interface method. This field must be a {@link Byte},
+ * {@link Boolean}, {@link Character}, {@link Short}, {@link Integer}, {@link Long},
+ * {@link Float}, {@link Double}, {@link String} or {@link 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. May be null .
*/
public Object annotationDefault;
/**
- * The runtime visible parameter annotations of this method. These lists are
- * lists of {@link AnnotationNode} objects. May be null .
+ * 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
* @label invisible parameters
@@ -123,8 +113,8 @@ public class MethodNode extends MethodVisitor {
public List[] visibleParameterAnnotations;
/**
- * The runtime invisible parameter annotations of this method. These lists
- * are lists of {@link AnnotationNode} objects. May be null .
+ * 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
* @label visible parameters
@@ -132,8 +122,7 @@ public class MethodNode extends MethodVisitor {
public List[] invisibleParameterAnnotations;
/**
- * The instructions of this method. This list is a list of
- * {@link AbstractInsnNode} objects.
+ * The instructions of this method. This list is a list of {@link AbstractInsnNode} objects.
*
* @associates org.objectweb.asm.tree.AbstractInsnNode
* @label instructions
@@ -141,8 +130,8 @@ public class MethodNode extends MethodVisitor {
public InsnList instructions;
/**
- * The try catch blocks of this method. This list is a list of
- * {@link TryCatchBlockNode} objects.
+ * The try catch blocks of this method. This list is a list of {@link TryCatchBlockNode}
+ * objects.
*
* @associates org.objectweb.asm.tree.TryCatchBlockNode
*/
@@ -159,8 +148,8 @@ public class MethodNode extends MethodVisitor {
public int maxLocals;
/**
- * The local variables of this method. This list is a list of
- * {@link LocalVariableNode} objects. May be