2 Replies Latest reply on Feb 23, 2005 9:50 AM by chiba

    Is CodeIterator.insertGap(int length) is supposed to insert

    ivangarcia44

      Hi,

      I am trying to use CodeIterator.insertGap(int length) to insert a gap at a point in the bytecode, but when I use it always inserts the gap at the end of the bytecode, even when I use the insertGap(int pos, int length) overload.

      This is the code that I am using:


      int newLength = iterator.insertGap(index, 4);

      The bytecode under test has a total of 29 bytes and the value of index in the test is 11. The "nop" opcodes appear from byte 30 to byte 33. They are supposed to appear from byte 11 to byte 14.

      Is there something that I might be doing wrong?

      Thanks,
      Ivan