diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-07-08 12:24:02 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-07-08 12:24:02 +0000 |
commit | fba9c3fa2abd83b2fdfa77ca56c0283113e5298b (patch) | |
tree | fd473a610e2ada758b57e7c1447b73842e04917d /src | |
parent | d51257fc947399ffee2158daf0f50946d39be5b0 (diff) | |
download | javassist-fba9c3fa2abd83b2fdfa77ca56c0283113e5298b.tar.gz javassist-fba9c3fa2abd83b2fdfa77ca56c0283113e5298b.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/main/javassist/CtNewMethod.java | 7 |
1 files changed, 4 insertions, 3 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 <code>setModifiers()</code> in <code>CtBehavior</code>. * * @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); } |