Пример #1
0
 /**
  * Inserts the given bytecode sequence exclusively before the instruction at the given index
  * <code>pos</code>. Branch offsets and the exception table are also updated.
  *
  * <p>If the instruction at the given index is at the beginning of a block statement, then the
  * bytecode is excluded from that block.
  *
  * <p>An extra gap may be inserted at the end of the inserted bytecode sequence for adjusting
  * alignment if the code attribute includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.
  *
  * <p>The index at which the byte sequence is actually inserted might be different from pos since
  * some other bytes might be inserted at other positions (e.g. to change <code>GOTO</code> to
  * <code>GOTO_W</code>).
  *
  * @param pos the index at which a byte sequence is inserted.
  * @param code inserted bytecode sequence.
  */
 public void insertEx(int pos, byte[] code) throws BadBytecode {
   insert0(pos, code, true);
 }
Пример #2
0
 /**
  * Inserts the given bytecode sequence before the instruction at the given index <code>pos</code>.
  * Branch offsets and the exception table are also updated.
  *
  * <p>If the instruction at the given index is at the beginning of a block statement, then the
  * bytecode is inserted within that block.
  *
  * <p>An extra gap may be inserted at the end of the inserted bytecode sequence for adjusting
  * alignment if the code attribute includes <code>LOOKUPSWITCH</code> or <code>TABLESWITCH</code>.
  *
  * <p>The index at which the byte sequence is actually inserted might be different from pos since
  * some other bytes might be inserted at other positions (e.g. to change <code>GOTO</code> to
  * <code>GOTO_W</code>).
  *
  * @param pos the index at which a byte sequence is inserted.
  * @param code inserted bytecode sequence.
  */
 public void insert(int pos, byte[] code) throws BadBytecode {
   insert0(pos, code, false);
 }