<code>CtClass</code> object is pruned, the bytecode of a method is not
accessible although method names and signatures are accessible.
-<p>(Note: the current version of Javassist turns pruning off by default.)
-
<p>To disallow pruning a <code>CtClass</code>, <code>stopPruning()</code>
must be called in advance:
cc.setSuperclass(...); // OK since the class is not frozen.
</pre></ul>
+<p>To disallow pruning for all the <code>CtClass</code>es, set
+<code>ClassPool.doPruning</code> to <code>false</code>.
<h4>Class search path</h4>
Move to the first instruction.<br>
<li><code>void move(int index)</code><br>
Move to the instruction specified by the given index.<br>
-<li><code>hasNext()</code><br>
+<li><code>boolean hasNext()</code><br>
Returns true if there is more instructions.<br>
-<li><code>next()</code><br>
-Returns the index of the next instruction.
+<li><code>int next()</code><br>
+Returns the index of the next instruction.<br>
<em>Note that it does not return the opcode of the next
instruction.</em><br>
<li><code>int byteAt(int index)</code><br>
Branch offsets etc. are automatically adjusted.<br>
</ul>
+<p>The following code snippet displays all the instructions included
+in a method body:
+
+<ul><pre>
+CodeIterator ci = ... ;
+while (ci.hasNext()) {
+ int index = ci.next();
+ int op = ci.byteAt(index);
+ System.out.println(Mnemonic.OPCODE[op]);
+}
+</pre></ul>
+
<p><br>
<a name="bytecode">