From 03e676c3ec809a09ebcc3ee3c2927e903d19e461 Mon Sep 17 00:00:00 2001 From: chiba Date: Mon, 19 May 2003 05:57:40 +0000 Subject: changed CtBehavior.setBody() so that setBody(null) produces a body including nothing but a return statement. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@20 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- tutorial/tutorial2.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'tutorial/tutorial2.html') diff --git a/tutorial/tutorial2.html b/tutorial/tutorial2.html index 5016474a..31d75f0b 100644 --- a/tutorial/tutorial2.html +++ b/tutorial/tutorial2.html @@ -489,10 +489,13 @@ catch (java.io.IOException e) {

CtMethod and CtConstructor provide setBody() for substituting a whole method body. They compile the given source text into Java bytecode -and substitutes it for the original method body. +and substitutes it for the original method body. If the given source +text is null, the substituted body includes only a +return statement, which returns zero or null unless the +result type is void.

In the source text given to setBody(), the identifiers -starting with $ have special meaning +starting with $ have special meaning