From fba9c3fa2abd83b2fdfa77ca56c0283113e5298b Mon Sep 17 00:00:00 2001 From: chiba Date: Thu, 8 Jul 2004 12:24:02 +0000 Subject: [PATCH] Fixed Bugs item #987038 (opened at 2004-07-08 15:06) git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@112 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/CtNewMethod.java | 7 ++++--- tutorial/tutorial.html | 4 ++-- tutorial/tutorial3.html | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/javassist/CtNewMethod.java b/src/main/javassist/CtNewMethod.java index eb65b73e..0a929d63 100644 --- a/src/main/javassist/CtNewMethod.java +++ b/src/main/javassist/CtNewMethod.java @@ -244,8 +244,9 @@ public class CtNewMethod { * Creates a public setter method. The setter method assigns the * value of the first parameter to the specified field * in the class to which this method is added. - * The created method is initially not static even if the field is - * static. Change the modifiers if the method should be static. + * The created method is not static even if the field is + * static. You may not change it to be static + * by setModifiers() in CtBehavior. * * @param methodName the name of the setter * @param field the field accessed. @@ -269,7 +270,7 @@ public class CtNewMethod { code.addPutfield(Bytecode.THIS, fieldName, fieldType); } else { - code.addLoad(0, field.getType()); + code.addLoad(1, field.getType()); code.addPutstatic(Bytecode.THIS, fieldName, fieldType); } diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html index 6c260011..6c9df81d 100644 --- a/tutorial/tutorial.html +++ b/tutorial/tutorial.html @@ -61,7 +61,7 @@ mapping between classes and CtClass objects. Javassist never allows two distinct CtClass objects to represent the same class unless two independent ClassPool are created. This is a significant feature for consistent program -transformaiton. To create multiple +transformation. To create multiple instances of ClassPool, write the following code: