* 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.
code.addPutfield(Bytecode.THIS, fieldName, fieldType);
}
else {
- code.addLoad(0, field.getType());
+ code.addLoad(1, field.getType());
code.addPutstatic(Bytecode.THIS, fieldName, fieldType);
}
never allows two distinct <code>CtClass</code> objects to represent
the same class unless two independent <code>ClassPool</code> are created.
This is a significant feature for consistent program
-transformaiton. To create multiple
+transformation. To create multiple
instances of <code>ClassPool</code>, write the following code:
<ul><pre>
<p>
This statement registers the class path that was used for loading
-the class of the object that <code>this</code> referes to.
+the class of the object that <code>this</code> refers to.
You can use any <code>Class</code> object as an argument instead of
<code>this.getClass()</code>. The class path used for loading the
class represented by that <code>Class</code> object is registered.