From 5de7634f05f343ff9573e140ea78a224d4ae3aa4 Mon Sep 17 00:00:00 2001 From: chiba Date: Mon, 20 Jun 2005 17:08:10 +0000 Subject: update the tutorial git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@183 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- tutorial/tutorial.html | 4 ++-- tutorial/tutorial3.html | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'tutorial') diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html index 4cbf6821..709d2148 100644 --- a/tutorial/tutorial.html +++ b/tutorial/tutorial.html @@ -130,8 +130,6 @@ example, the data of method bodies. Thus, after a CtClass object is pruned, the bytecode of a method is not accessible although method names and signatures are accessible. -

(Note: the current version of Javassist turns pruning off by default.) -

To disallow pruning a CtClass, stopPruning() must be called in advance: @@ -155,6 +153,8 @@ cc.defrost(); cc.setSuperclass(...); // OK since the class is not frozen. +

To disallow pruning for all the CtClasses, set +ClassPool.doPruning to false.

Class search path

diff --git a/tutorial/tutorial3.html b/tutorial/tutorial3.html index f19e5c0d..657e629b 100644 --- a/tutorial/tutorial3.html +++ b/tutorial/tutorial3.html @@ -124,10 +124,10 @@ The following methods are part of the methods declared in Move to the first instruction.
  • void move(int index)
    Move to the instruction specified by the given index.
    -
  • hasNext()
    +
  • boolean hasNext()
    Returns true if there is more instructions.
    -
  • next()
    -Returns the index of the next instruction. +
  • int next()
    +Returns the index of the next instruction.
    Note that it does not return the opcode of the next instruction.
  • int byteAt(int index)
    @@ -141,6 +141,18 @@ Inserts a byte array at the index. Branch offsets etc. are automatically adjusted.
    +

    The following code snippet displays all the instructions included +in a method body: + +

    +


    -- cgit v1.2.3